]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: more cleanups on _do_write_small()
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 6 Oct 2016 08:33:00 +0000 (16:33 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 6 Oct 2016 08:33:00 +0000 (16:33 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index 22edee92f993e70fe0d3a32738b4d037dd13503d..cff11c5e0f847f0c93c4c5e00e4e3ae9831af07c 100644 (file)
@@ -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?