]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: drop redundant boundary check
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 3 Nov 2016 03:18:25 +0000 (11:18 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 3 Nov 2016 06:18:24 +0000 (14:18 +0800)
As we have done the sanity check ahead.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index 11ecbf5d35ca29a98446265caa78159d79459671..78c0b5ea7371c80584a1bfc45fbe49868e7b15bd 100644 (file)
@@ -549,10 +549,7 @@ void BlueStore::Cache::trim(
     return;
   }
 
-  uint64_t need_to_free = 0;
-  if (current > target_bytes) {
-    need_to_free = current - target_bytes;
-  }
+  uint64_t need_to_free = current - target_bytes;
   uint64_t free_buffer = 0;
   uint64_t free_meta = 0;
   if (current_buffer > target_buffer) {