[thin_repair] repair now checks the data reference counts.
This commit is contained in:
15
btree.tcc
15
btree.tcc
@@ -614,32 +614,33 @@ template <unsigned Levels, typename ValueTraits, uint32_t BlockSize>
|
||||
void
|
||||
btree<Levels, ValueTraits, BlockSize>::visit(typename visitor::ptr visitor)
|
||||
{
|
||||
walk_tree(visitor, 0, root_);
|
||||
walk_tree(visitor, 0, true, root_);
|
||||
}
|
||||
|
||||
template <unsigned Levels, typename ValueTraits, uint32_t BlockSize>
|
||||
void
|
||||
btree<Levels, ValueTraits, BlockSize>::
|
||||
walk_tree(typename visitor::ptr visitor,
|
||||
unsigned level, block_address b)
|
||||
unsigned level, bool is_root,
|
||||
block_address b)
|
||||
{
|
||||
using namespace btree_detail;
|
||||
|
||||
auto blk = tm_->read_lock(b);
|
||||
auto o = to_node<uint64_traits, BlockSize>(blk);
|
||||
if (o.get_type() == INTERNAL) {
|
||||
visitor->visit_internal(level, o);
|
||||
visitor->visit_internal(level, is_root, o);
|
||||
for (unsigned i = 0; i < o.get_nr_entries(); i++)
|
||||
walk_tree(visitor, level, o.value_at(i));
|
||||
walk_tree(visitor, level, false, o.value_at(i));
|
||||
|
||||
} else if (level < Levels - 1) {
|
||||
visitor->visit_internal_leaf(level, o);
|
||||
visitor->visit_internal_leaf(level, is_root, o);
|
||||
for (unsigned i = 0; i < o.get_nr_entries(); i++)
|
||||
walk_tree(visitor, level + 1, o.value_at(i));
|
||||
walk_tree(visitor, level + 1, true, o.value_at(i));
|
||||
|
||||
} else {
|
||||
auto ov = to_node<ValueTraits, BlockSize>(blk);
|
||||
visitor->visit_leaf(level, ov);
|
||||
visitor->visit_leaf(level, is_root, ov);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user