summaryrefslogtreecommitdiff
path: root/lib/backupstore/BackupStoreAccounts.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-02-07 23:05:04 +0000
committerChris Wilson <chris+github@qwirx.com>2014-02-07 23:05:04 +0000
commit58f09a365624705b25d29aa3caeefa0d97d1c9ba (patch)
tree3953575fa781527d604b2a03d64db6ecc551a849 /lib/backupstore/BackupStoreAccounts.cpp
parentb8d2733b33c1dd2491c60fe9f68f612e6de503e4 (diff)
Create new refcount database atomically during account check.
Use a temporary refcount db for check instead of an in-memory vector. This avoid the memory usage problems created by using the vector on large accounts, but may require us to improve the efficiency of the refcount database itself to avoid large numbers of small I/O operations. That is very doable now that we're using a class for it. Fix some inconsistencies and mistakes in handling reference counts and info counters during account checks (more to come).
Diffstat (limited to 'lib/backupstore/BackupStoreAccounts.cpp')
-rw-r--r--lib/backupstore/BackupStoreAccounts.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/backupstore/BackupStoreAccounts.cpp b/lib/backupstore/BackupStoreAccounts.cpp
index d9efcd5d..6a4d846c 100644
--- a/lib/backupstore/BackupStoreAccounts.cpp
+++ b/lib/backupstore/BackupStoreAccounts.cpp
@@ -120,10 +120,7 @@ void BackupStoreAccounts::Create(int32_t ID, int DiscSet, int64_t SizeSoftLimit,
info->Save();
// Create the refcount database
- BackupStoreRefCountDatabase::CreateNew(Entry);
- std::auto_ptr<BackupStoreRefCountDatabase> refcount(
- BackupStoreRefCountDatabase::Load(Entry, false));
- refcount->AddReference(BACKUPSTORE_ROOT_DIRECTORY_ID);
+ BackupStoreRefCountDatabase::Create(Entry)->Commit();
}
// As the original user...