return bdev[id]->supported_bdev_label();
}
-uint64_t BlueFS::get_block_device_size(unsigned id) const
-{
- if (id < bdev.size() && bdev[id])
- return bdev[id]->get_size();
- return 0;
-}
-
BlockDevice* BlueFS::get_block_device(unsigned id) const
{
if (id < bdev.size() && bdev[id])
uint64_t BlueFS::_get_total(unsigned id) const
{
ceph_assert(id < bdev.size());
- return get_block_device_size(id);
+ return bdev[id] ? bdev[id]->get_size() : 0;
}
uint64_t BlueFS::get_total(unsigned id)
if (vselector == nullptr) {
vselector.reset(
new OriginalVolumeSelector(
- get_block_device_size(BlueFS::BDEV_WAL) * 95 / 100,
- get_block_device_size(BlueFS::BDEV_DB) * 95 / 100,
- get_block_device_size(BlueFS::BDEV_SLOW) * 95 / 100));
+ _get_total(BlueFS::BDEV_WAL) * 95 / 100,
+ _get_total(BlueFS::BDEV_DB) * 95 / 100,
+ _get_total(BlueFS::BDEV_SLOW) * 95 / 100));
}
_init_logger();
if (vselector == nullptr) {
vselector.reset(
new OriginalVolumeSelector(
- get_block_device_size(BlueFS::BDEV_WAL) * 95 / 100,
- get_block_device_size(BlueFS::BDEV_DB) * 95 / 100,
- get_block_device_size(BlueFS::BDEV_SLOW) * 95 / 100));
+ _get_total(BlueFS::BDEV_WAL) * 95 / 100,
+ _get_total(BlueFS::BDEV_DB) * 95 / 100,
+ _get_total(BlueFS::BDEV_SLOW) * 95 / 100));
}
_init_alloc();
int add_block_device(unsigned bdev, const std::string& path, bool trim,
bluefs_shared_alloc_context_t* _shared_alloc = nullptr);
bool bdev_support_label(unsigned id);
- uint64_t get_block_device_size(unsigned bdev) const;
BlockDevice* get_block_device(unsigned bdev) const;
// handler for discard event
}
if (cct->_conf->bluestore_volume_selection_policy == "fit_to_fast") {
vselector = new FitToFastVolumeSelector(
- bluefs->get_block_device_size(BlueFS::BDEV_WAL) * 95 / 100,
- bluefs->get_block_device_size(BlueFS::BDEV_DB) * 95 / 100,
- bluefs->get_block_device_size(BlueFS::BDEV_SLOW) * 95 / 100);
+ bluefs->get_total(BlueFS::BDEV_WAL) * 95 / 100,
+ bluefs->get_total(BlueFS::BDEV_DB) * 95 / 100,
+ bluefs->get_total(BlueFS::BDEV_SLOW) * 95 / 100);
} else {
double reserved_factor = cct->_conf->bluestore_volume_selection_reserved_factor;
vselector =
new RocksDBBlueFSVolumeSelector(
- bluefs->get_block_device_size(BlueFS::BDEV_WAL) * 95 / 100,
- bluefs->get_block_device_size(BlueFS::BDEV_DB) * 95 / 100,
- bluefs->get_block_device_size(BlueFS::BDEV_SLOW) * 95 / 100,
+ bluefs->get_total(BlueFS::BDEV_WAL) * 95 / 100,
+ bluefs->get_total(BlueFS::BDEV_DB) * 95 / 100,
+ bluefs->get_total(BlueFS::BDEV_SLOW) * 95 / 100,
rocks_opts.write_buffer_size * rocks_opts.max_write_buffer_number,
rocks_opts.max_bytes_for_level_base,
rocks_opts.max_bytes_for_level_multiplier,