From 00b0bed4b6488d61201cdbd94d9c76345cd7c4a2 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 27 Aug 2010 09:21:17 +0000 Subject: Report changes to object and block counts that are made by housekeeping. --- bin/bbstored/HousekeepStoreAccount.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bin/bbstored') diff --git a/bin/bbstored/HousekeepStoreAccount.cpp b/bin/bbstored/HousekeepStoreAccount.cpp index 4ed33d22..5d4291de 100644 --- a/bin/bbstored/HousekeepStoreAccount.cpp +++ b/bin/bbstored/HousekeepStoreAccount.cpp @@ -115,6 +115,9 @@ void HousekeepStoreAccount::DoHousekeeping(bool KeepTryingForever) // Load the store info to find necessary info for the housekeeping std::auto_ptr info(BackupStoreInfo::Load(mAccountID, mStoreRoot, mStoreDiscSet, false /* Read/Write */)); + std::auto_ptr pOldInfo( + BackupStoreInfo::Load(mAccountID, mStoreRoot, mStoreDiscSet, + true /* Read Only */)); // Calculate how much should be deleted mDeletionSizeTarget = info->GetBlocksUsed() - info->GetBlocksSoftLimit(); @@ -148,8 +151,9 @@ void HousekeepStoreAccount::DoHousekeeping(bool KeepTryingForever) info->ChangeBlocksUsed(mBlocksUsedDelta); info->ChangeBlocksInOldFiles(mBlocksInOldFilesDelta); info->ChangeBlocksInDeletedFiles(mBlocksInDeletedFilesDelta); - + // Save the store info back + info->ReportChangesTo(*pOldInfo); info->Save(); } @@ -197,6 +201,8 @@ void HousekeepStoreAccount::DoHousekeeping(bool KeepTryingForever) info->CorrectAllUsedValues(mBlocksUsed, mBlocksInOldFiles, mBlocksInDeletedFiles, mBlocksInDirectories + mBlocksInDirectoriesDelta); + + info->ReportChangesTo(*pOldInfo); info->Save(); } } @@ -343,6 +349,7 @@ void HousekeepStoreAccount::DoHousekeeping(bool KeepTryingForever) info->ChangeBlocksInDirectories(mBlocksInDirectoriesDelta); // Save the store info back + info->ReportChangesTo(*pOldInfo); info->Save(); // Explicity release the lock (would happen automatically on -- cgit v1.2.3