From ff6da97f8c8a95a9fa2b0400c07a58c783daf135 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 28 Dec 2016 15:43:28 +0800 Subject: [PATCH] os/bluestore/BitAllocator: kill find_any_free_bits() Which has no consumers. Signed-off-by: xie xingguo --- src/os/bluestore/BitAllocator.cc | 31 ------------------------------- src/os/bluestore/BitAllocator.h | 4 ---- 2 files changed, 35 deletions(-) diff --git a/src/os/bluestore/BitAllocator.cc b/src/os/bluestore/BitAllocator.cc index d7ed7de9c225..14501f0b77f0 100644 --- a/src/os/bluestore/BitAllocator.cc +++ b/src/os/bluestore/BitAllocator.cc @@ -341,37 +341,6 @@ BmapEntry::find_first_set_bits(int64_t required_blocks, return allocated; } -/* - * Find N number of free bits in bitmap. Need not be contiguous. - */ -int BmapEntry::find_any_free_bits(int start_offset, int64_t num_blocks, - ExtentList *allocated_blocks, int64_t block_offset, int64_t *scanned) -{ - int allocated = 0; - int required = num_blocks; - int i = 0; - - *scanned = 0; - - if (atomic_fetch() == BmapEntry::full_bmask()) { - return 0; - } - - /* - * Do a serial scan on bitmap. - */ - for (i = start_offset; i < BmapEntry::size() && - allocated < required; i++) { - if (check_n_set_bit(i)) { - allocated_blocks->add_extents(i + block_offset, 1); - allocated++; - } - } - - *scanned = i - start_offset; - return allocated; -} - void BmapEntry::dump_state(int& count) { dout(0) << count << ":: 0x" << std::hex << m_bits << dendl; diff --git a/src/os/bluestore/BitAllocator.h b/src/os/bluestore/BitAllocator.h index 38150fbd40e2..db2ecc405e00 100644 --- a/src/os/bluestore/BitAllocator.h +++ b/src/os/bluestore/BitAllocator.h @@ -184,10 +184,6 @@ public: int find_first_set_bits(int64_t required_blocks, int bit_offset, int *start_offset, int64_t *scanned); - int find_any_free_bits(int start_offset, int64_t num_blocks, - ExtentList *alloc_list, int64_t block_offset, - int64_t *scanned); - void dump_state(int& count); ~BmapEntry(); -- 2.47.3