diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-02-09 13:45:56 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-02-09 13:45:56 +0000 |
commit | d67e5aaba0bd5157f460c11b4a320069369b0e7f (patch) | |
tree | 403d960e1dd82342e78651d35de51908587dfd63 /lib/backupstore/BackupStoreCheck.cpp | |
parent | b84a408c093a193dade2eaef3779665a6ab2c581 (diff) |
Fix accounting in bbstoreaccounts check.
Fix accounting for current, old and deleted files and blocks. Previously there
was confusion over the meaning of NumFiles, now it's defined to mean the number
of current files (neither old nor deleted), similar to BlocksInCurrentFiles.
Diffstat (limited to 'lib/backupstore/BackupStoreCheck.cpp')
-rw-r--r-- | lib/backupstore/BackupStoreCheck.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/lib/backupstore/BackupStoreCheck.cpp b/lib/backupstore/BackupStoreCheck.cpp index b7bd23ce..957475e4 100644 --- a/lib/backupstore/BackupStoreCheck.cpp +++ b/lib/backupstore/BackupStoreCheck.cpp @@ -746,24 +746,27 @@ void BackupStoreCheck::CheckDirectories() BOX_FORMAT_OBJECTID(en->GetObjectID()) << " with flags " << en->GetFlags()); } - // otherwise it's a good file, add to sizes - else if(en->IsDeleted()) // even if it's Old, - // it's still Deleted, don't count it twice. + else // it's a good file, add to sizes { - mNumFiles++; - mNumDeletedFiles++; - mBlocksInDeletedFiles += en->GetSizeInBlocks(); - } - else if(en->IsOld()) - { - mNumFiles++; - mNumOldFiles++; - mBlocksInOldFiles += en->GetSizeInBlocks(); - } - else - { - mNumFiles++; - mBlocksInCurrentFiles += en->GetSizeInBlocks(); + // It can be both old and deleted. + // If neither, then it's current. + if(en->IsDeleted()) + { + mNumDeletedFiles++; + mBlocksInDeletedFiles += en->GetSizeInBlocks(); + } + + if(en->IsOld()) + { + mNumOldFiles++; + mBlocksInOldFiles += en->GetSizeInBlocks(); + } + + if(!en->IsDeleted() && !en->IsOld()) + { + mNumFiles++; + mBlocksInCurrentFiles += en->GetSizeInBlocks(); + } } } } |