]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
batch is_allocated bit checks 10704/head
authorRamesh Chander <Ramesh.Chander@sandisk.com>
Fri, 12 Aug 2016 06:27:38 +0000 (23:27 -0700)
committerRamesh Chander <Ramesh.Chander@sandisk.com>
Fri, 12 Aug 2016 07:27:48 +0000 (00:27 -0700)
Signed-off-by: Ramesh Chander <Ramesh.Chander@sandisk.com>
src/os/bluestore/BitAllocator.cc

index c03f84be5ec9ce4b8d53748c4c3dec6ecd4bbc03..63489038b4e7ec9318fc137417a86a86ddef5b62 100644 (file)
@@ -143,14 +143,10 @@ bmap_t BmapEntry::atomic_fetch()
   return m_bits;
 }
 
-bool BmapEntry::is_allocated(int64_t start_bit, int64_t num_bits)
+bool BmapEntry::is_allocated(int64_t offset, int64_t num_bits)
 {
-  for (int i = start_bit; i < num_bits + start_bit; i++) {
-    if (!check_bit(i)) {
-      return false;
-    }
-  }
-  return true;
+  bmap_t bmask = BmapEntry::align_mask(num_bits) >> offset;
+  return ((m_bits & bmask) == bmask);
 }
 
 void BmapEntry::clear_bit(int bit)