[all tools] Factor out open_bm() and open_tm.

Many duplicates of this code.
This commit is contained in:
Joe Thornber
2017-10-05 11:53:40 +01:00
parent 924a996fa7
commit 3c761e6822
11 changed files with 44 additions and 122 deletions

View File

@@ -37,18 +37,6 @@
using namespace thin_provisioning;
using namespace persistent_data;
//----------------------------------------------------------------
namespace {
transaction_manager::ptr
open_tm(block_manager<>::ptr bm) {
space_map::ptr sm(new core_map(bm->get_nr_blocks()));
sm->inc(superblock_detail::SUPERBLOCK_LOCATION);
transaction_manager::ptr tm(new transaction_manager(bm, sm));
return tm;
}
}
//---------------------------------------------------------------------------
namespace {
@@ -212,7 +200,8 @@ namespace {
if (f.device_details_root_)
sb.device_details_root_ = *f.device_details_root_;
transaction_manager::ptr tm = open_tm(bm);
transaction_manager::ptr tm =
open_tm(bm, superblock_detail::SUPERBLOCK_LOCATION);
indented_stream out(output);