[Box Backup-commit] COMMIT r2706 - box/trunk/bin/bbstored
subversion at boxbackup.org
subversion at boxbackup.org
Fri Aug 27 10:21:18 BST 2010
Author: chris
Date: 2010-08-27 10:21:17 +0100 (Fri, 27 Aug 2010)
New Revision: 2706
Modified:
box/trunk/bin/bbstored/HousekeepStoreAccount.cpp
Log:
Report changes to object and block counts that are made by housekeeping.
Modified: box/trunk/bin/bbstored/HousekeepStoreAccount.cpp
===================================================================
--- box/trunk/bin/bbstored/HousekeepStoreAccount.cpp 2010-08-27 09:20:30 UTC (rev 2705)
+++ box/trunk/bin/bbstored/HousekeepStoreAccount.cpp 2010-08-27 09:21:17 UTC (rev 2706)
@@ -115,6 +115,9 @@
// Load the store info to find necessary info for the housekeeping
std::auto_ptr<BackupStoreInfo> info(BackupStoreInfo::Load(mAccountID,
mStoreRoot, mStoreDiscSet, false /* Read/Write */));
+ std::auto_ptr<BackupStoreInfo> pOldInfo(
+ BackupStoreInfo::Load(mAccountID, mStoreRoot, mStoreDiscSet,
+ true /* Read Only */));
// Calculate how much should be deleted
mDeletionSizeTarget = info->GetBlocksUsed() - info->GetBlocksSoftLimit();
@@ -148,8 +151,9 @@
info->ChangeBlocksUsed(mBlocksUsedDelta);
info->ChangeBlocksInOldFiles(mBlocksInOldFilesDelta);
info->ChangeBlocksInDeletedFiles(mBlocksInDeletedFilesDelta);
-
+
// Save the store info back
+ info->ReportChangesTo(*pOldInfo);
info->Save();
}
@@ -197,6 +201,8 @@
info->CorrectAllUsedValues(mBlocksUsed,
mBlocksInOldFiles, mBlocksInDeletedFiles,
mBlocksInDirectories + mBlocksInDirectoriesDelta);
+
+ info->ReportChangesTo(*pOldInfo);
info->Save();
}
}
@@ -343,6 +349,7 @@
info->ChangeBlocksInDirectories(mBlocksInDirectoriesDelta);
// Save the store info back
+ info->ReportChangesTo(*pOldInfo);
info->Save();
// Explicity release the lock (would happen automatically on
More information about the Boxbackup-commit
mailing list