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

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


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

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


Modified: box/RELEASE/0.11rc7/bin/bbstored/HousekeepStoreAccount.cpp
===================================================================
--- box/RELEASE/0.11rc7/bin/bbstored/HousekeepStoreAccount.cpp	2010-03-08 21:22:09 UTC (rev 2654)
+++ box/RELEASE/0.11rc7/bin/bbstored/HousekeepStoreAccount.cpp	2010-03-08 21:22:42 UTC (rev 2655)
@@ -416,9 +416,27 @@
 		// Add it to the list of directories to potentially delete
 		mEmptyDirectories.push_back(dir.GetObjectID());
 	}
-	
+
+	// Calculate reference counts first, before we start requesting
+	// files to be deleted.
 	// BLOCK
 	{
+		BackupStoreDirectory::Iterator i(dir);
+		BackupStoreDirectory::Entry *en = 0;
+
+		while((en = i.Next()) != 0)
+		{
+			// This directory references this object
+			if (mNewRefCounts.size() <= en->GetObjectID())
+			{
+				mNewRefCounts.resize(en->GetObjectID() + 1, 0);
+			}
+			mNewRefCounts[en->GetObjectID()]++;
+		}
+	}
+
+	// BLOCK
+	{
 		// Remove any files which are marked for removal as soon
 		// as they become old or deleted.
 		bool deletedSomething = false;
@@ -463,13 +481,6 @@
 
 		while((en = i.Next(BackupStoreDirectory::Entry::Flags_File)) != 0)
 		{
-			// This directory references this object
-			if (mNewRefCounts.size() <= en->GetObjectID())
-			{
-				mNewRefCounts.resize(en->GetObjectID() + 1, 0);
-			}
-			mNewRefCounts[en->GetObjectID()]++;
-
 			// Update recalculated usage sizes
 			int16_t enFlags = en->GetFlags();
 			int64_t enSizeInBlocks = en->GetSizeInBlocks();
@@ -578,13 +589,6 @@
 		BackupStoreDirectory::Entry *en = 0;
 		while((en = i.Next(BackupStoreDirectory::Entry::Flags_Dir)) != 0)
 		{
-			// This parent directory references this child
-			if (mNewRefCounts.size() <= en->GetObjectID())
-			{
-				mNewRefCounts.resize(en->GetObjectID() + 1, 0);
-			}
-			mNewRefCounts[en->GetObjectID()]++;
-
 			// Next level
 			ASSERT((en->GetFlags() & BackupStoreDirectory::Entry::Flags_Dir) == BackupStoreDirectory::Entry::Flags_Dir);
 			




More information about the Boxbackup-commit mailing list