m_area_index = zone_num;
BitMapZone::total_blocks = total_blocks;
alloc_assert(size() > 0);
- m_type = ZONE;
m_used_blocks = def? total_blocks: 0;
return cct->_conf->bluestore_bitmapallocator_span_size;
}
-bmap_area_type_t BitMapArea::level_to_type(int level)
-{
- if (level == 0) {
- return ZONE;
- } else if (level == 1) {
- return LEAF;
- } else {
- return NON_LEAF;
- }
-}
-
int BitMapArea::get_level(CephContext* cct, int64_t total_blocks)
{
int level = 1;
return m_area_index;
}
-bmap_area_type_t BitMapArea::get_type()
-{
- return m_type;
-}
-
/*
* BitMapArea Leaf and Internal
*/
m_area_index = area_idx;
m_total_blocks = total_blocks;
m_level = BitMapArea::get_level(cct, total_blocks);
- m_type = BitMapArea::level_to_type(m_level);
m_reserved_blocks = 0;
m_used_blocks = def? total_blocks: 0;
};
-typedef enum bmap_area_type {
- UNDEFINED = 0,
- ZONE = 1,
- LEAF = 2,
- NON_LEAF = 3
-} bmap_area_type_t;
-
class BitMapArea {
protected:
int16_t m_area_index;
- bmap_area_type_t m_type;
public:
MEMPOOL_CLASS_HELPERS();
static int64_t get_zone_size(CephContext* cct);
static int64_t get_span_size(CephContext* cct);
- bmap_area_type_t level_to_type(int level);
static int get_level(CephContext* cct, int64_t total_blocks);
static int64_t get_level_factor(CephContext* cct, int level);
virtual bool is_allocated(int64_t start_block, int64_t num_blocks) = 0;
int64_t child_count();
int64_t get_index();
int64_t get_level();
- bmap_area_type_t get_type();
virtual void dump_state(CephContext* cct, int& count) = 0;
- BitMapArea(CephContext*)
- : m_type(UNDEFINED) {
- }
+ BitMapArea(CephContext*) { }
virtual ~BitMapArea() { }
};