]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: avoid temporary bufferlist in _flush_range().
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 19 Aug 2020 10:56:21 +0000 (12:56 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 21 Aug 2020 16:55:58 +0000 (18:55 +0200)
`bufferlist::splice()` is already piecewise -- it uses the variant
of `bufferlist::appned()` that merges adjacent bptrs.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/os/bluestore/BlueFS.cc

index 15b0c10e8b885ff8893b4be2beb0010d88340c02..90cb9239efcb2a27f7a2af0842232f25ab7d5031 100644 (file)
@@ -2759,9 +2759,7 @@ ceph::bufferlist BlueFS::FileWriter::flush_buffer(
     /* in case of inital allocation and need to zero, limited flush is unacceptable */
     bl.claim_append_piecewise(buffer);
   } else {
-    bufferlist t;
-    buffer.splice(0, length, &t);
-    bl.claim_append_piecewise(t);
+    buffer.splice(0, length, &bl);
     dout(20) << " leaving 0x" << std::hex << buffer.length() << std::dec
              << " unflushed" << dendl;
   }