]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: simplify is_exhausted() method
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 6 Jul 2016 03:40:10 +0000 (11:40 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sun, 10 Jul 2016 13:25:47 +0000 (21:25 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BitAllocator.cc

index 190962afc086d594e43acf3ca596d43002e94188..96528826e2760bea9a2c26c0314bb7bff135962d 100644 (file)
@@ -419,11 +419,7 @@ BitMapZone::~BitMapZone()
 bool BitMapZone::is_exhausted()
 {
   debug_assert(check_locked());
-  if (get_used_blocks() == size()) {
-    return true;
-  } else {
-    return false;
-  }
+  return get_used_blocks() == size();
 }
 
 bool BitMapZone::is_allocated(int64_t start_block, int64_t num_blocks)
@@ -523,10 +519,7 @@ void BitMapZone::lock_excl()
 
 bool BitMapZone::lock_excl_try()
 {
-  if (m_lock.try_lock()) {
-    return true;
-  }
-  return false;
+  return m_lock.try_lock();
 }
 
 void BitMapZone::unlock()
@@ -793,10 +786,7 @@ void BitMapAreaIN::child_unlock(BitMapArea *child)
 
 bool BitMapAreaIN::is_exhausted()
 {
-  if (get_used_blocks() == size()) {
-    return true;
-  }
-  return false;
+  return get_used_blocks() == size();
 }
 
 int64_t BitMapAreaIN::add_used_blocks(int64_t blks)