thin dump now does something useful

This commit is contained in:
Joe Thornber
2011-10-10 14:10:30 +01:00
parent 16539b59ff
commit d255180e37
12 changed files with 342 additions and 17 deletions

View File

@@ -105,10 +105,11 @@ namespace {
// Sharing can only occur in level 1 nodes.
// FIXME: not true once we start having held roots.
bool visit_internal_leaf(unsigned level,
bool sub_root,
optional<uint64_t> key,
btree_detail::node_ref<uint64_traits> const &n) {
bool r = btree_checker<2, block_traits>::visit_internal_leaf(level, key, n);
bool r = btree_checker<2, block_traits>::visit_internal_leaf(level, sub_root, key, n);
if (!r && level == 0) {
throw runtime_error("unexpected sharing in level 0 of mapping tree.");
}
@@ -120,9 +121,10 @@ namespace {
}
bool visit_leaf(unsigned level,
bool sub_root,
optional<uint64_t> key,
btree_detail::node_ref<block_traits> const &n) {
bool r = btree_checker<2, block_traits>::visit_leaf(level, key, n);
bool r = btree_checker<2, block_traits>::visit_leaf(level, sub_root, key, n);
if (r)
for (unsigned i = 0; i < n.get_nr_entries(); i++)
@@ -149,9 +151,10 @@ namespace {
}
bool visit_leaf(unsigned level,
bool sub_root,
optional<uint64_t> key,
btree_detail::node_ref<device_details_traits> const &n) {
bool r = btree_checker<1, device_details_traits>::visit_leaf(level, key, n);
bool r = btree_checker<1, device_details_traits>::visit_leaf(level, sub_root, key, n);
if (r)
for (unsigned i = 0; i < n.get_nr_entries(); i++)