From: xie xingguo Date: Thu, 6 Oct 2016 08:33:00 +0000 (+0800) Subject: os/bluestore: more cleanups on _do_write_small() X-Git-Tag: v11.0.1~5^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9837f981ae6beafd68f3859372cbd9d4fb25c1d0;p=ceph.git os/bluestore: more cleanups on _do_write_small() Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 22edee92f993..cff11c5e0f84 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7271,7 +7271,7 @@ void BlueStore::_do_write_small( } } while (ep != o->extent_map.extent_map.end()) { - if (ep->logical_offset >= ep->blob_offset + offset + length) { + if (ep->logical_offset >= ep->blob_offset + end) { break; } b = ep->blob; @@ -7309,15 +7309,14 @@ void BlueStore::_do_write_small( z.append_zero(head_pad); z.claim_append(padded); padded.claim(z); - logger->inc(l_bluestore_write_pad_bytes, head_pad); } if (tail_pad) { padded.append_zero(tail_pad); - logger->inc(l_bluestore_write_pad_bytes, tail_pad); } if (head_pad || tail_pad) { dout(20) << __func__ << " can pad head 0x" << std::hex << head_pad << " tail 0x" << tail_pad << std::dec << dendl; + logger->inc(l_bluestore_write_pad_bytes, head_pad + tail_pad); } // direct write into unused blocks of an existing mutable blob?