From: xie xingguo Date: Wed, 28 Dec 2016 07:43:28 +0000 (+0800) Subject: os/bluestore/BitAllocator: kill find_any_free_bits() X-Git-Tag: v12.0.0~152^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F12696%2Fhead;p=ceph.git os/bluestore/BitAllocator: kill find_any_free_bits() Which has no consumers. Signed-off-by: xie xingguo --- 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();