Skip to content

Commit

Permalink
Removed get_available_blocks() api completely
Browse files Browse the repository at this point in the history
  • Loading branch information
hkadayam committed Oct 30, 2023
1 parent 5da63c0 commit f5e8b27
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions src/lib/blkalloc/bitmap_blk_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class BlkAllocPortion {
mutable std::mutex m_blk_lock;
blk_num_t m_portion_num;
blk_temp_t m_temperature;
blk_num_t m_available_blocks;

public:
BlkAllocPortion(blk_temp_t temp = default_temperature()) : m_temperature(temp) {}
Expand All @@ -55,7 +54,6 @@ class BlkAllocPortion {

auto portion_auto_lock() const { return std::scoped_lock< std::mutex >(m_blk_lock); }
blk_num_t get_portion_num() const { return m_portion_num; }
blk_num_t get_available_blocks() const { return m_available_blocks; }
blk_temp_t temperature() const { return m_temperature; }

void set_portion_num(blk_num_t portion_num) { m_portion_num = portion_num; }
Expand Down
3 changes: 1 addition & 2 deletions src/lib/blkalloc/varsize_blk_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,7 @@ blk_count_t VarsizeBlkAllocator::alloc_blks_direct(blk_count_t nblks, blk_alloc_
auto const end_blk_id = cur_blk_id + get_blks_per_portion() - 1;
{
auto lock{portion.portion_auto_lock()};
while (nblks_remain && (cur_blk_id <= end_blk_id) && portion.get_available_blocks() &&
out_blkid.has_room()) {
while (nblks_remain && (cur_blk_id <= end_blk_id) && out_blkid.has_room()) {
// Get next reset bits and insert to cache and then reset those bits
auto const b = m_cache_bm->get_next_contiguous_n_reset_bits(
cur_blk_id, end_blk_id, std::min(min_blks, nblks_remain), nblks_remain);
Expand Down

0 comments on commit f5e8b27

Please sign in to comment.