summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2010-02-28 15:34:47 +0000
committerChris Wilson <chris+github@qwirx.com>2010-02-28 15:34:47 +0000
commiteafdab7f681b3977bdbe1c6671d022afe1b045cd (patch)
treeaab94694bdf32e33cd5ea5ed8d4546a0690bb5b4 /bin
parent2b7dccc09ecce61b694a189b1f674e6b20df74eb (diff)
Log keeping referenced files and deleting unreferenced ones on the
store.
Diffstat (limited to 'bin')
-rw-r--r--bin/bbstored/HousekeepStoreAccount.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/bbstored/HousekeepStoreAccount.cpp b/bin/bbstored/HousekeepStoreAccount.cpp
index a7a3bc22..9ed821a7 100644
--- a/bin/bbstored/HousekeepStoreAccount.cpp
+++ b/bin/bbstored/HousekeepStoreAccount.cpp
@@ -889,15 +889,23 @@ void HousekeepStoreAccount::DeleteFile(int64_t InDirectory, int64_t ObjectID, Ba
}
// Drop reference count by one. If it reaches zero, delete the file.
- if (--mNewRefCounts[ObjectID] == 0)
+ if(--mNewRefCounts[ObjectID] == 0)
{
// Delete from disc
+ BOX_TRACE("Removing unreferenced object " <<
+ BOX_FORMAT_OBJECTID(ObjectID));
std::string objFilename;
MakeObjectFilename(ObjectID, objFilename);
RaidFileWrite del(mStoreDiscSet, objFilename,
mNewRefCounts[ObjectID]);
del.Delete();
}
+ else
+ {
+ BOX_TRACE("Preserving object " <<
+ BOX_FORMAT_OBJECTID(ObjectID) << " with " <<
+ mNewRefCounts[ObjectID] << " references");
+ }
// Adjust counts for the file
++mFilesDeleted;