From eafdab7f681b3977bdbe1c6671d022afe1b045cd Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 28 Feb 2010 15:34:47 +0000 Subject: Log keeping referenced files and deleting unreferenced ones on the store. --- bin/bbstored/HousekeepStoreAccount.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bin/bbstored/HousekeepStoreAccount.cpp') 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; -- cgit v1.2.3