Skip to content

Commit

Permalink
os/bluestore: add support for allocating 0-sized extent
Browse files Browse the repository at this point in the history
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 <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Jul 6, 2016
1 parent 120c24a commit 3ba1ca9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/os/bluestore/BitMapAllocator.cc
Expand Up @@ -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;
Expand Down

0 comments on commit 3ba1ca9

Please sign in to comment.