]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BitMapAllocator: make nblks calculationg simpler and faster
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 17 May 2016 11:44:14 +0000 (19:44 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 17 May 2016 11:44:14 +0000 (19:44 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BitMapAllocator.cc

index 22cd3a5217d23406ca0f9a5a1ffc7848533e5d29..846ba6bc249a74596755bde875e78a980ceea989 100644 (file)
@@ -88,8 +88,7 @@ int BitMapAllocator::allocate(
 {
 
   assert(!(alloc_unit % m_block_size));
-  int64_t len = NEXT_MULTIPLE(want_size, m_block_size);
-  int64_t nblks = len / m_block_size;
+  int64_t nblks = (want_size + m_block_size - 1) / m_block_size;
 
   assert(alloc_unit);