roots automatically get their ref count bumped now

This commit is contained in:
Joe Thornber 2011-08-26 15:30:14 +01:00
parent 90675d3a95
commit 19c7144b3b
3 changed files with 2 additions and 6 deletions

View File

@ -27,10 +27,8 @@ namespace persistent_data {
count_map::iterator it = counts_.find(b);
if (it == counts_.end())
counts_.insert(make_pair(b, 1));
#if 0
else
it->second++;
#endif
}
unsigned get_count(block_address b) const {

View File

@ -374,12 +374,10 @@ metadata::check()
mapping_validator::ptr mv(new mapping_validator(metadata_counter,
data_counter));
metadata_counter.inc(mappings_.get_root());
mappings_.visit(mv);
set<uint64_t> const &mapped_devs = mv->get_devices();
details_validator::ptr dv(new details_validator(metadata_counter));
metadata_counter.inc(details_.get_root());
details_.visit(dv);
set<uint64_t> const &details_devs = dv->get_devices();

View File

@ -245,7 +245,6 @@ namespace persistent_data {
virtual void check(block_counter &counter) const {
typename ref_count_validator<BlockSize>::ptr v(new ref_count_validator<BlockSize>(counter));
counter.inc(ref_counts_.get_root());
ref_counts_.visit(v);
}
@ -441,6 +440,7 @@ namespace persistent_data {
counter.inc(bitmap_root_);
for (unsigned i = 0; i < entries_.size(); i++)
if (entries_[i].blocknr_ != 0) // superblock
counter.inc(entries_[i].blocknr_);
}