]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #12696 from xiexingguo/xxg-wip-improve-loops
authorSage Weil <sage@redhat.com>
Wed, 18 Jan 2017 13:36:45 +0000 (07:36 -0600)
committerGitHub <noreply@github.com>
Wed, 18 Jan 2017 13:36:45 +0000 (07:36 -0600)
os/bluestore: miscellaneous fixes to BitAllocator

Reviewed-by: Ramesh Chander <Ramesh.Chander@sandisk.com>
1  2 
src/os/bluestore/BitAllocator.cc
src/os/bluestore/BitAllocator.h
src/os/bluestore/bluestore_types.cc
src/os/bluestore/bluestore_types.h

index 18b63d6510a585bb2540dd01e664d58059d80065,14501f0b77f029eba260c9708caca85e823885eb..9f241dbedf62fa188e32174097627e06c40f3b6a
@@@ -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;
  }
  
  /*
Simple merge
Simple merge
Simple merge