]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: simplify marking unused logic of blob tail 11129/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 19 Sep 2016 10:30:46 +0000 (18:30 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 19 Sep 2016 12:23:35 +0000 (20:23 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index c0b36b08b6ab426583f877fa5d5857eb5f43b0dc..2035f7ff660d6968898b9cf64afcbd6bffaeafbc 100644 (file)
@@ -7352,13 +7352,12 @@ int BlueStore::_do_alloc_write(
     }
     if (wi.mark_unused) {
       auto b_off = wi.b_off;
-      auto b_len = wi.bl.length();
+      auto b_end = b_off + wi.bl.length();
       if (b_off) {
         b->dirty_blob().add_unused(0, b_off);
       }
-      if (b_off + b_len < wi.blob_length) {
-        b->dirty_blob().add_unused(b_off + b_len,
-                                  wi.blob_length - (b_off + b_len));
+      if (b_end < wi.blob_length) {
+        b->dirty_blob().add_unused(b_end, wi.blob_length - b_end);
       }
     }