[Box Backup-commit] COMMIT r2645 - box/trunk/bin/bbstored

subversion at boxbackup.org subversion at boxbackup.org
Sun Feb 28 15:34:48 GMT 2010


Author: chris
Date: 2010-02-28 15:34:47 +0000 (Sun, 28 Feb 2010)
New Revision: 2645

Modified:
   box/trunk/bin/bbstored/HousekeepStoreAccount.cpp
Log:
Log keeping referenced files and deleting unreferenced ones on the 
store.


Modified: box/trunk/bin/bbstored/HousekeepStoreAccount.cpp
===================================================================
--- box/trunk/bin/bbstored/HousekeepStoreAccount.cpp	2010-02-26 14:36:53 UTC (rev 2644)
+++ box/trunk/bin/bbstored/HousekeepStoreAccount.cpp	2010-02-28 15:34:47 UTC (rev 2645)
@@ -889,15 +889,23 @@
 	}
 
 	// 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;




More information about the Boxbackup-commit mailing list