From: xie xingguo Date: Tue, 17 May 2016 11:44:14 +0000 (+0800) Subject: os/bluestore/BitMapAllocator: make nblks calculationg simpler and faster X-Git-Tag: v11.0.0~367^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=679ed51748d64d7cc5b01b755f35c0e432924074;p=ceph.git os/bluestore/BitMapAllocator: make nblks calculationg simpler and faster Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BitMapAllocator.cc b/src/os/bluestore/BitMapAllocator.cc index 22cd3a5217d2..846ba6bc249a 100644 --- a/src/os/bluestore/BitMapAllocator.cc +++ b/src/os/bluestore/BitMapAllocator.cc @@ -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);