[thin_pool] Encapsulate metadata into the pool class
This commit is contained in:
parent
5810846409
commit
0b058a2850
@ -104,9 +104,20 @@ thin::set_mapped_blocks(block_address count)
|
||||
|
||||
//--------------------------------
|
||||
|
||||
thin_pool::thin_pool(metadata::ptr md)
|
||||
: md_(md)
|
||||
thin_pool::thin_pool(block_manager::ptr bm)
|
||||
{
|
||||
md_ = metadata::ptr(new metadata(bm, true));
|
||||
}
|
||||
|
||||
thin_pool::thin_pool(block_manager::ptr bm,
|
||||
sector_t data_block_size,
|
||||
block_address nr_data_blocks)
|
||||
{
|
||||
md_ = metadata::ptr(new metadata(bm,
|
||||
metadata::CREATE,
|
||||
data_block_size,
|
||||
nr_data_blocks));
|
||||
md_->commit();
|
||||
}
|
||||
|
||||
thin_pool::~thin_pool()
|
||||
|
@ -58,7 +58,10 @@ namespace thin_provisioning {
|
||||
public:
|
||||
typedef std::shared_ptr<thin_pool> ptr;
|
||||
|
||||
thin_pool(metadata::ptr md);
|
||||
thin_pool(block_manager::ptr bm);
|
||||
thin_pool(block_manager::ptr bm,
|
||||
sector_t data_block_size,
|
||||
block_address nr_data_blocks);
|
||||
~thin_pool();
|
||||
|
||||
void create_thin(thin_dev_t dev);
|
||||
|
Loading…
Reference in New Issue
Block a user