[caching/metadata] superblock was being zeroed on creation, rather than letting the constructor do it's stuff.

This commit is contained in:
Joe Thornber 2013-10-11 11:02:04 +01:00
parent d54bc41026
commit 6aae6aabb4

View File

@ -64,28 +64,11 @@ metadata::setup_hint_array(size_t width)
new hint_array(tm_, 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 void
metadata::create_metadata(block_manager<>::ptr bm) metadata::create_metadata(block_manager<>::ptr bm)
{ {
tm_ = open_tm(bm); tm_ = open_tm(bm);
::memset(&sb_, 0, sizeof(sb_));
init_superblock();
space_map::ptr core = tm_->get_sm(); space_map::ptr core = tm_->get_sm();
metadata_sm_ = create_metadata_sm(tm_, tm_->get_bm()->get_nr_blocks()); metadata_sm_ = create_metadata_sm(tm_, tm_->get_bm()->get_nr_blocks());
copy_space_maps(metadata_sm_, core); copy_space_maps(metadata_sm_, core);
@ -143,7 +126,7 @@ metadata::commit_hints()
void void
metadata::commit_discard_bits() metadata::commit_discard_bits()
{ {
// FIXME: finish sb_.discard_root = discard_bits_->get_root();
} }
void void