Introduce mapping_tree.h
This commit is contained in:
@@ -108,8 +108,10 @@ metadata::metadata(std::string const &dev_path, open_type ot,
|
||||
|
||||
data_sm_ = open_disk_sm(tm_, static_cast<void *>(&sb_.data_space_map_root_));
|
||||
details_ = device_tree::ptr(new device_tree(tm_, sb_.device_details_root_, device_tree_detail::device_details_traits::ref_counter()));
|
||||
mappings_top_level_ = dev_tree::ptr(new dev_tree(tm_, sb_.data_mapping_root_, mtree_ref_counter(tm_)));
|
||||
mappings_ = mapping_tree::ptr(new mapping_tree(tm_, sb_.data_mapping_root_, block_time_ref_counter(data_sm_)));
|
||||
mappings_top_level_ = dev_tree::ptr(new dev_tree(tm_, sb_.data_mapping_root_,
|
||||
mapping_tree_detail::mtree_ref_counter(tm_)));
|
||||
mappings_ = mapping_tree::ptr(new mapping_tree(tm_, sb_.data_mapping_root_,
|
||||
mapping_tree_detail::block_time_ref_counter(data_sm_)));
|
||||
break;
|
||||
|
||||
case CREATE:
|
||||
@@ -121,8 +123,10 @@ metadata::metadata(std::string const &dev_path, open_type ot,
|
||||
|
||||
data_sm_ = create_disk_sm(tm_, nr_data_blocks);
|
||||
details_ = device_tree::ptr(new device_tree(tm_, device_tree_detail::device_details_traits::ref_counter()));
|
||||
mappings_ = mapping_tree::ptr(new mapping_tree(tm_, block_time_ref_counter(data_sm_)));
|
||||
mappings_top_level_ = dev_tree::ptr(new dev_tree(tm_, mappings_->get_root(), mtree_ref_counter(tm_)));
|
||||
mappings_ = mapping_tree::ptr(new mapping_tree(tm_,
|
||||
mapping_tree_detail::block_time_ref_counter(data_sm_)));
|
||||
mappings_top_level_ = dev_tree::ptr(new dev_tree(tm_, mappings_->get_root(),
|
||||
mapping_tree_detail::mtree_ref_counter(tm_)));
|
||||
|
||||
::memset(&sb_, 0, sizeof(sb_));
|
||||
sb_.magic_ = SUPERBLOCK_MAGIC;
|
||||
@@ -147,8 +151,10 @@ metadata::metadata(std::string const &dev_path, block_address metadata_snap)
|
||||
|
||||
data_sm_ = open_disk_sm(tm_, static_cast<void *>(&sb_.data_space_map_root_));
|
||||
details_ = device_tree::ptr(new device_tree(tm_, sb_.device_details_root_, device_tree_detail::device_details_traits::ref_counter()));
|
||||
mappings_top_level_ = dev_tree::ptr(new dev_tree(tm_, sb_.data_mapping_root_, mtree_ref_counter(tm_)));
|
||||
mappings_ = mapping_tree::ptr(new mapping_tree(tm_, sb_.data_mapping_root_, block_time_ref_counter(data_sm_)));
|
||||
mappings_top_level_ = dev_tree::ptr(new dev_tree(tm_, sb_.data_mapping_root_,
|
||||
mapping_tree_detail::mtree_ref_counter(tm_)));
|
||||
mappings_ = mapping_tree::ptr(new mapping_tree(tm_, sb_.data_mapping_root_,
|
||||
mapping_tree_detail::block_time_ref_counter(data_sm_)));
|
||||
}
|
||||
|
||||
// FIXME: duplication
|
||||
@@ -169,8 +175,10 @@ metadata::metadata(block_manager<>::ptr bm, open_type ot,
|
||||
|
||||
data_sm_ = open_disk_sm(tm_, static_cast<void *>(&sb_.data_space_map_root_));
|
||||
details_ = device_tree::ptr(new device_tree(tm_, sb_.device_details_root_, device_tree_detail::device_details_traits::ref_counter()));
|
||||
mappings_top_level_ = dev_tree::ptr(new dev_tree(tm_, sb_.data_mapping_root_, mtree_ref_counter(tm_)));
|
||||
mappings_ = mapping_tree::ptr(new mapping_tree(tm_, sb_.data_mapping_root_, block_time_ref_counter(data_sm_)));
|
||||
mappings_top_level_ = dev_tree::ptr(new dev_tree(tm_, sb_.data_mapping_root_,
|
||||
mapping_tree_detail::mtree_ref_counter(tm_)));
|
||||
mappings_ = mapping_tree::ptr(new mapping_tree(tm_, sb_.data_mapping_root_,
|
||||
mapping_tree_detail::block_time_ref_counter(data_sm_)));
|
||||
break;
|
||||
|
||||
case CREATE:
|
||||
@@ -182,8 +190,10 @@ metadata::metadata(block_manager<>::ptr bm, open_type ot,
|
||||
|
||||
data_sm_ = create_disk_sm(tm_, nr_data_blocks);
|
||||
details_ = device_tree::ptr(new device_tree(tm_, device_tree_detail::device_details_traits::ref_counter()));
|
||||
mappings_ = mapping_tree::ptr(new mapping_tree(tm_, block_time_ref_counter(data_sm_)));
|
||||
mappings_top_level_ = dev_tree::ptr(new dev_tree(tm_, mappings_->get_root(), mtree_ref_counter(tm_)));
|
||||
mappings_ = mapping_tree::ptr(new mapping_tree(tm_,
|
||||
mapping_tree_detail::block_time_ref_counter(data_sm_)));
|
||||
mappings_top_level_ = dev_tree::ptr(new dev_tree(tm_, mappings_->get_root(),
|
||||
mapping_tree_detail::mtree_ref_counter(tm_)));
|
||||
|
||||
::memset(&sb_, 0, sizeof(sb_));
|
||||
sb_.magic_ = SUPERBLOCK_MAGIC;
|
||||
|
||||
Reference in New Issue
Block a user