diff --git a/thin-provisioning/device_checker.cc b/thin-provisioning/device_checker.cc index 6521f95..dcca01b 100644 --- a/thin-provisioning/device_checker.cc +++ b/thin-provisioning/device_checker.cc @@ -5,7 +5,7 @@ using namespace thin_provisioning; //---------------------------------------------------------------- device_checker::device_checker(block_manager::ptr bm) - : bm_(bm) + : checker(bm) { } diff --git a/thin-provisioning/device_checker.h b/thin-provisioning/device_checker.h index 413f49e..ff4d561 100644 --- a/thin-provisioning/device_checker.h +++ b/thin-provisioning/device_checker.h @@ -10,10 +10,6 @@ namespace thin_provisioning { public: device_checker(block_manager::ptr bm); damage_list_ptr check(); - - private: - block_manager::ptr bm_; - damage_list_ptr damage_; }; } diff --git a/thin-provisioning/metadata_checker.cc b/thin-provisioning/metadata_checker.cc index f6badc5..5276a0b 100644 --- a/thin-provisioning/metadata_checker.cc +++ b/thin-provisioning/metadata_checker.cc @@ -165,6 +165,13 @@ metadata_damage_visitor::visit(metadata_damage const &damage) damage.visit(*this); } +//-------------------------------- + +checker::checker(block_manager::ptr bm) + : bm_(bm) +{ +} + //---------------------------------------------------------------- #if 0 diff --git a/thin-provisioning/metadata_checker.h b/thin-provisioning/metadata_checker.h index 4c37e1c..16f5ebb 100644 --- a/thin-provisioning/metadata_checker.h +++ b/thin-provisioning/metadata_checker.h @@ -156,8 +156,13 @@ namespace thin_provisioning { typedef persistent_data::block_manager<> block_manager; typedef boost::shared_ptr ptr; + checker(block_manager::ptr bm); + virtual ~checker() {}; virtual damage_list_ptr check() = 0; + + protected: + block_manager::ptr bm_; }; } diff --git a/thin-provisioning/superblock_checker.cc b/thin-provisioning/superblock_checker.cc index 91b6ba1..f2dd625 100644 --- a/thin-provisioning/superblock_checker.cc +++ b/thin-provisioning/superblock_checker.cc @@ -9,8 +9,7 @@ using namespace thin_provisioning; //---------------------------------------------------------------- superblock_checker::superblock_checker(block_manager::ptr bm) - : bm_(bm), - damage(new damage_list) + : checker(bm) { } diff --git a/thin-provisioning/superblock_checker.h b/thin-provisioning/superblock_checker.h index bf0253b..fd50a5d 100644 --- a/thin-provisioning/superblock_checker.h +++ b/thin-provisioning/superblock_checker.h @@ -10,11 +10,6 @@ namespace thin_provisioning { public: superblock_checker(block_manager::ptr bm); damage_list_ptr check(); - - private: - // FIXME: surely we can push these down to the base class? - block_manager::ptr bm_; - damage_list_ptr damage; }; }