From 6aae6aabb480e2f3c17d9ebb065fd246bf8bcc6e Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 11 Oct 2013 11:02:04 +0100 Subject: [PATCH] [caching/metadata] superblock was being zeroed on creation, rather than letting the constructor do it's stuff. --- caching/metadata.cc | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/caching/metadata.cc b/caching/metadata.cc index 7ff3acb..bfb5a30 100644 --- a/caching/metadata.cc +++ b/caching/metadata.cc @@ -64,28 +64,11 @@ metadata::setup_hint_array(size_t width) new hint_array(tm_, width)); } -void -metadata::init_superblock() -{ -#if 0 - sb_.magic_ = SUPERBLOCK_MAGIC; - sb_.version_ = 1; - sb_.data_mapping_root_ = mappings_->get_root(); - sb_.device_details_root_ = details_->get_root(); - sb_.data_block_size_ = data_block_size; - sb_.metadata_block_size_ = MD_BLOCK_SIZE; - sb_.metadata_nr_blocks_ = tm_->get_bm()->get_nr_blocks(); -#endif -} - void metadata::create_metadata(block_manager<>::ptr bm) { tm_ = open_tm(bm); - ::memset(&sb_, 0, sizeof(sb_)); - init_superblock(); - space_map::ptr core = tm_->get_sm(); metadata_sm_ = create_metadata_sm(tm_, tm_->get_bm()->get_nr_blocks()); copy_space_maps(metadata_sm_, core); @@ -143,7 +126,7 @@ metadata::commit_hints() void metadata::commit_discard_bits() { - // FIXME: finish + sb_.discard_root = discard_bits_->get_root(); } void