From 50de60d6a3a21296b5a76812b47eea91c887fb38 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Sat, 4 Jun 2016 11:01:05 +0800 Subject: [PATCH] bluestore/BitAllocator: make assert make more sense Signed-off-by: xie xingguo --- src/os/bluestore/BitAllocator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BitAllocator.cc b/src/os/bluestore/BitAllocator.cc index d15f698d17e29..6b819b37cbb8e 100644 --- a/src/os/bluestore/BitAllocator.cc +++ b/src/os/bluestore/BitAllocator.cc @@ -600,8 +600,8 @@ int64_t BitMapZone::alloc_blocks(int64_t num_blocks, int64_t *start_block) void BitMapZone::free_blocks(int64_t start_block, int64_t num_blocks) { free_blocks_int(start_block, num_blocks); - debug_assert(get_used_blocks() > 0); sub_used_blocks(num_blocks); + debug_assert(get_used_blocks() >= 0); } /* @@ -1596,7 +1596,7 @@ void BitAllocator::free_blocks_dis(int64_t num_blocks, int64_t *block_list) free_blocks_int(block_list[i], 1); } - debug_assert(get_used_blocks() > 0); sub_used_blocks(num_blocks); + debug_assert(get_used_blocks() >= 0); unlock(); } -- 2.39.5