diff options
author | Chris Wilson <chris+github@qwirx.com> | 2010-02-28 15:34:47 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2010-02-28 15:34:47 +0000 |
commit | eafdab7f681b3977bdbe1c6671d022afe1b045cd (patch) | |
tree | aab94694bdf32e33cd5ea5ed8d4546a0690bb5b4 /bin/bbstored/HousekeepStoreAccount.cpp | |
parent | 2b7dccc09ecce61b694a189b1f674e6b20df74eb (diff) |
Log keeping referenced files and deleting unreferenced ones on the
store.
Diffstat (limited to 'bin/bbstored/HousekeepStoreAccount.cpp')
-rw-r--r-- | bin/bbstored/HousekeepStoreAccount.cpp | 10 |
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; |