From: Sage Weil Date: Wed, 18 Jan 2017 13:36:45 +0000 (-0600) Subject: Merge pull request #12696 from xiexingguo/xxg-wip-improve-loops X-Git-Tag: v12.0.0~152 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=212522178cfc53e336aa76498ad2809df2d6872b;p=ceph.git Merge pull request #12696 from xiexingguo/xxg-wip-improve-loops os/bluestore: miscellaneous fixes to BitAllocator Reviewed-by: Ramesh Chander --- 212522178cfc53e336aa76498ad2809df2d6872b diff --cc src/os/bluestore/BitAllocator.cc index 18b63d6510a58,14501f0b77f02..9f241dbedf62f --- a/src/os/bluestore/BitAllocator.cc +++ b/src/os/bluestore/BitAllocator.cc @@@ -334,40 -341,9 +334,9 @@@ BmapEntry::find_first_set_bits(int64_t 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; + dout(0) << count << ":: 0x" << std::hex << m_bits << std::dec << dendl; } /*