summaryrefslogtreecommitdiff
path: root/bin/bbstored
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2010-08-27 09:21:17 +0000
committerChris Wilson <chris+github@qwirx.com>2010-08-27 09:21:17 +0000
commit00b0bed4b6488d61201cdbd94d9c76345cd7c4a2 (patch)
treefae01be3b93ed5d35a3918110d39a31d8ca58775 /bin/bbstored
parent8c56480ffa1e7f24042dc11e415e042a400205ef (diff)
Report changes to object and block counts that are made by housekeeping.
Diffstat (limited to 'bin/bbstored')
-rw-r--r--bin/bbstored/HousekeepStoreAccount.cpp9
1 files changed, 8 insertions, 1 deletions
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<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 @@ 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