diff --git a/btree_validator.h b/btree_checker.h similarity index 96% rename from btree_validator.h rename to btree_checker.h index bcb84f4..f8f4dee 100644 --- a/btree_validator.h +++ b/btree_checker.h @@ -1,5 +1,5 @@ -#ifndef BTREE_VALIDATOR_H -#define BTREE_VALIDATOR_H +#ifndef BTREE_CHECKER_H +#define BTREE_CHECKER_H #include "btree.h" @@ -65,9 +65,9 @@ namespace persistent_data { // - leaf | internal flags (this can be inferred from siblings) //---------------------------------------------------------------- template - class btree_validator : public btree::visitor { + class btree_checker : public btree::visitor { public: - btree_validator(block_counter &counter) + btree_checker(block_counter &counter) : counter_(counter), errs_(new error_set("btree errors")) { } diff --git a/metadata.cc b/metadata.cc index 3b974e9..b8b18b3 100644 --- a/metadata.cc +++ b/metadata.cc @@ -1,6 +1,6 @@ #include "metadata.h" -#include "btree_validator.h" +#include "btree_checker.h" #include "core_map.h" #include @@ -45,12 +45,12 @@ namespace { // devices having mappings defined, which can later be cross // referenced with the details tree. A separate block_counter is // used to later verify the data space map. - class mapping_validator : public btree_validator<2, block_traits> { + class mapping_validator : public btree_checker<2, block_traits> { public: typedef boost::shared_ptr ptr; mapping_validator(block_counter &metadata_counter, block_counter &data_counter) - : btree_validator<2, block_traits>(metadata_counter), + : btree_checker<2, block_traits>(metadata_counter), data_counter_(data_counter) { } @@ -59,7 +59,7 @@ namespace { bool visit_internal_leaf(unsigned level, bool is_root, btree_detail::node_ref const &n) { - bool r = btree_validator<2, block_traits>::visit_internal_leaf(level, is_root, n); + bool r = btree_checker<2, block_traits>::visit_internal_leaf(level, is_root, n); if (!r && level == 0) { throw runtime_error("unexpected sharing in level 0 of mapping tree."); } @@ -72,7 +72,7 @@ namespace { bool visit_leaf(unsigned level, bool is_root, btree_detail::node_ref const &n) { - bool r = btree_validator<2, block_traits>::visit_leaf(level, is_root, n); + bool r = btree_checker<2, block_traits>::visit_leaf(level, is_root, n); if (r) for (unsigned i = 0; i < n.get_nr_entries(); i++) @@ -90,17 +90,17 @@ namespace { set devices_; }; - class details_validator : public btree_validator<1, device_details_traits> { + class details_validator : public btree_checker<1, device_details_traits> { public: typedef boost::shared_ptr ptr; details_validator(block_counter &counter) - : btree_validator<1, device_details_traits>(counter) { + : btree_checker<1, device_details_traits>(counter) { } bool visit_leaf(unsigned level, bool is_root, btree_detail::node_ref const &n) { - bool r = btree_validator<1, device_details_traits>::visit_leaf(level, is_root, n); + bool r = btree_checker<1, device_details_traits>::visit_leaf(level, is_root, n); if (r) for (unsigned i = 0; i < n.get_nr_entries(); i++) diff --git a/space_map_disk.cc b/space_map_disk.cc index 281fce6..a5531c0 100644 --- a/space_map_disk.cc +++ b/space_map_disk.cc @@ -109,12 +109,12 @@ namespace { } }; - class ref_count_validator : public btree_validator<1, ref_count_traits> { + class ref_count_validator : public btree_checker<1, ref_count_traits> { public: typedef boost::shared_ptr ptr; ref_count_validator(block_counter &counter) - : btree_validator<1, ref_count_traits>(counter) { + : btree_checker<1, ref_count_traits>(counter) { } }; @@ -307,21 +307,21 @@ namespace { btree<1, ref_count_traits> ref_counts_; }; - class bitmap_tree_validator : public btree_validator<1, index_entry_traits> { + class bitmap_tree_validator : public btree_checker<1, index_entry_traits> { public: typedef boost::shared_ptr ptr; bitmap_tree_validator(block_counter &counter) - : btree_validator<1, index_entry_traits>(counter) { + : btree_checker<1, index_entry_traits>(counter) { } bool visit_leaf(unsigned level, bool is_root, btree_detail::node_ref const &n) { - bool r = btree_validator<1, index_entry_traits>::visit_leaf(level, is_root, n); + bool r = btree_checker<1, index_entry_traits>::visit_leaf(level, is_root, n); if (r) for (unsigned i = 0; i < n.get_nr_entries(); i++) - btree_validator<1, index_entry_traits>::get_counter().inc(n.value_at(i).blocknr_); + btree_checker<1, index_entry_traits>::get_counter().inc(n.value_at(i).blocknr_); return r; } diff --git a/space_map_disk.h b/space_map_disk.h index e5b0863..3038dda 100644 --- a/space_map_disk.h +++ b/space_map_disk.h @@ -1,7 +1,7 @@ #ifndef SPACE_MAP_DISK_H #define SPACE_MAP_DISK_H -#include "btree_validator.h" +#include "btree_checker.h" #include "space_map.h" //----------------------------------------------------------------