[Box Backup-commit] COMMIT r2653 - box/RELEASE/0.11rc7/bin/bbstored

subversion at boxbackup.org subversion at boxbackup.org
Mon Mar 8 21:21:22 GMT 2010


Author: chris
Date: 2010-03-08 21:21:22 +0000 (Mon, 08 Mar 2010)
New Revision: 2653

Modified:
   box/RELEASE/0.11rc7/bin/bbstored/HousekeepStoreAccount.cpp
Log:
Merge [2645] into 0.11rc7.


Modified: box/RELEASE/0.11rc7/bin/bbstored/HousekeepStoreAccount.cpp
===================================================================
--- box/RELEASE/0.11rc7/bin/bbstored/HousekeepStoreAccount.cpp	2010-03-08 21:18:26 UTC (rev 2652)
+++ box/RELEASE/0.11rc7/bin/bbstored/HousekeepStoreAccount.cpp	2010-03-08 21:21:22 UTC (rev 2653)
@@ -879,13 +879,22 @@
 		padjustedEntry.reset();	// delete it now
 	}
 
-	// Delete from disc
+	// Drop reference count by one. If it reaches zero, delete the file.
+	if(--mNewRefCounts[ObjectID] == 0)
 	{
+		BOX_TRACE("Removing unreferenced object " <<
+			BOX_FORMAT_OBJECTID(ObjectID));
 		std::string objFilename;
 		MakeObjectFilename(ObjectID, objFilename);
 		RaidFileWrite del(mStoreDiscSet, objFilename);
 		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