ceph_assert(align != 0);
uint64_t *cursor = &lbas[cbits(align) - 1];
- const int free_pct = num_free * 100 / num_total;
+ const int free_pct = num_free * 100 / device_size;
uint64_t start = 0;
/*
* If we're running low on space switch to using the size
for (auto p = release_set.begin(); p != release_set.end(); ++p) {
const auto offset = p.get_start();
const auto length = p.get_len();
- ceph_assert(offset + length <= uint64_t(num_total));
+ ceph_assert(offset + length <= uint64_t(device_size));
ldout(cct, 10) << __func__ << std::hex
<< " offset 0x" << offset
<< " length 0x" << length
uint64_t max_mem,
const std::string& name) :
Allocator(name, device_size, block_size),
- num_total(device_size),
- block_size(block_size),
range_size_alloc_threshold(
cct->_conf.get_val<uint64_t>("bluestore_avl_alloc_bf_threshold")),
range_size_alloc_free_pct(
int64_t block_size,
const std::string& name) :
Allocator(name, device_size, block_size),
- num_total(device_size),
- block_size(block_size),
range_size_alloc_threshold(
cct->_conf.get_val<uint64_t>("bluestore_avl_alloc_bf_threshold")),
range_size_alloc_free_pct(
void AvlAllocator::init_add_free(uint64_t offset, uint64_t length)
{
std::lock_guard l(lock);
- ceph_assert(offset + length <= uint64_t(num_total));
+ ceph_assert(offset + length <= uint64_t(device_size));
ldout(cct, 10) << __func__ << std::hex
<< " offset 0x" << offset
<< " length 0x" << length
void AvlAllocator::init_rm_free(uint64_t offset, uint64_t length)
{
std::lock_guard l(lock);
- ceph_assert(offset + length <= uint64_t(num_total));
+ ceph_assert(offset + length <= uint64_t(device_size));
ldout(cct, 10) << __func__ << std::hex
<< " offset 0x" << offset
<< " length 0x" << length
int64_t hint,
PExtentVector *extents) override;
void release(const interval_set<uint64_t>& release_set) override;
- int64_t get_capacity() const {
- return num_total;
- }
-
- uint64_t get_block_size() const {
- return block_size;
- }
uint64_t get_free() override;
double get_fragmentation() override;
boost::intrusive::constant_time_size<true>>;
range_size_tree_t range_size_tree;
- const int64_t num_total; ///< device size
- const uint64_t block_size; ///< block size
uint64_t num_free = 0; ///< total bytes in freelist
/*
std::mutex lock;
double _get_fragmentation() const {
- auto free_blocks = p2align(num_free, block_size) / block_size;
+ auto free_blocks = p2align(num_free, (uint64_t)block_size) / block_size;
if (free_blocks <= 1) {
return .0;
}