From: xie xingguo Date: Wed, 6 Jul 2016 07:13:38 +0000 (+0800) Subject: os/bluestore: add support for allocating 0-sized extent X-Git-Tag: ses5-milestone5~437^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10040%2Fhead;p=ceph.git os/bluestore: add support for allocating 0-sized extent For testing, we may choose randomized length of extent to allocate, which means we could trim down the length to 0. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BitMapAllocator.cc b/src/os/bluestore/BitMapAllocator.cc index d42093e79b1f..ac3037e20143 100644 --- a/src/os/bluestore/BitMapAllocator.cc +++ b/src/os/bluestore/BitMapAllocator.cc @@ -105,6 +105,8 @@ int BitMapAllocator::allocate( uint64_t want_size, uint64_t alloc_unit, int64_t hint, uint64_t *offset, uint32_t *length) { + if (want_size == 0) + return 0; assert(!(alloc_unit % m_block_size)); int64_t nblks = (want_size + m_block_size - 1) / m_block_size;