From: xie xingguo Date: Mon, 19 Sep 2016 10:30:46 +0000 (+0800) Subject: os/bluestore: simplify marking unused logic of blob tail X-Git-Tag: v11.0.1~169^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11129%2Fhead;p=ceph.git os/bluestore: simplify marking unused logic of blob tail Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index c0b36b08b6ab..2035f7ff660d 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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); } }