[thin-provisioning] Add a new constructor for the metadata class

This one takes a superblock.  Used when repairing.
This commit is contained in:
Joe Thornber 2019-04-17 12:15:46 +01:00
parent b777a77023
commit b027a1039f
2 changed files with 10 additions and 0 deletions

View File

@ -134,6 +134,13 @@ metadata::metadata(block_manager<>::ptr bm,
open_btrees(); open_btrees();
} }
metadata::metadata(block_manager<>::ptr bm, superblock_detail::superblock const &sb)
{
tm_ = open_tm(bm, SUPERBLOCK_LOCATION);
sb_ = sb;
open_btrees();
}
void void
metadata::commit() metadata::commit()
{ {

View File

@ -78,6 +78,9 @@ namespace thin_provisioning {
metadata(block_manager<>::ptr, metadata(block_manager<>::ptr,
boost::optional<block_address> metadata_snap); // (ii) and (iii) boost::optional<block_address> metadata_snap); // (ii) and (iii)
// This is used by repair, when we rebuild the superblock
metadata(block_manager<>::ptr bm, superblock_detail::superblock const &sb);
void commit(); void commit();