[thin_pool] Encapsulate metadata into the pool class
This commit is contained in:
		@@ -104,9 +104,20 @@ thin::set_mapped_blocks(block_address count)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
//--------------------------------
 | 
					//--------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
thin_pool::thin_pool(metadata::ptr md)
 | 
					thin_pool::thin_pool(block_manager::ptr bm)
 | 
				
			||||||
	: md_(md)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						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()
 | 
					thin_pool::~thin_pool()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,7 +58,10 @@ namespace thin_provisioning {
 | 
				
			|||||||
	public:
 | 
						public:
 | 
				
			||||||
		typedef std::shared_ptr<thin_pool> ptr;
 | 
							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();
 | 
							~thin_pool();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		void create_thin(thin_dev_t dev);
 | 
							void create_thin(thin_dev_t dev);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user