// for bluefs, label (4k) + bluefs super (4k), means we start at 8k.
#define BLUEFS_START 8192
-
/*
* object name key structure
*
kv_stop(false),
logger(NULL),
csum_type(bluestore_blob_t::CSUM_CRC32C),
- min_alloc_size(0),
- max_alloc_size(0),
sync_wal_apply(cct->_conf->bluestore_sync_wal_apply)
{
_init_logger();
void BlueStore::_set_alloc_sizes(void)
{
- max_alloc_size = g_conf->bluestore_max_alloc_size;
/*
* Set device block size according to its media
*/
min_alloc_size = g_conf->bluestore_min_alloc_size_ssd;
}
}
+ min_alloc_size_order = ctz(min_alloc_size);
+ assert(min_alloc_size == 1u << min_alloc_size_order);
+
+ max_alloc_size = g_conf->bluestore_max_alloc_size;
dout(10) << __func__ << " min_alloc_size 0x" << std::hex << min_alloc_size
- << " max_alloc_size 0x" << max_alloc_size
+ << std::dec << " order " << min_alloc_size_order
+ << " max_alloc_size 0x" << std::hex << max_alloc_size
<< std::dec << dendl;
}
// initialize global block parameters
block_size = bdev->get_block_size();
block_mask = ~(block_size - 1);
- block_size_order = 0;
- for (uint64_t t = 1; t < block_size; t <<= 1) {
- ++block_size_order;
- }
+ block_size_order = ctz(block_size);
+ assert(block_size == 1u << block_size_order);
_set_alloc_sizes();
max_alloc_size = g_conf->bluestore_max_alloc_size;
uint64_t block_mask; ///< mask to get just the block offset
size_t block_size_order; ///< bits to shift to get block size
- uint64_t min_alloc_size; ///< minimum allocation unit (power of 2)
+ uint64_t min_alloc_size = 0; ///< minimum allocation unit (power of 2)
+ size_t min_alloc_size_order = 0; ///< bits for min_alloc_size
uint64_t max_alloc_size; ///< maximum allocation unit (power of 2)