]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/filestore/FileJournal: avoid push_front
authorSage Weil <sage@redhat.com>
Tue, 3 Apr 2018 15:06:19 +0000 (10:06 -0500)
committerSage Weil <sage@redhat.com>
Tue, 3 Apr 2018 15:07:05 +0000 (10:07 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/filestore/FileJournal.cc

index e52ed031d08746d1f6179d4dc8d21ee870c5c5bb..0c0940dc506dccc0c46644d1a8ce159b801e94ea 100644 (file)
@@ -1079,7 +1079,10 @@ void FileJournal::do_write(bufferlist& bl)
     // header too?
     if (hbp.length()) {
       // be sneaky: include the header in the second fragment
-      second.push_front(hbp);
+      bufferlist tmp;
+      tmp.push_back(hbp);
+      tmp.claim_append(second);
+      second.swap(tmp);
       pos = 0;          // we included the header
     }
     // Write the second portion first possible with the header, so
@@ -1335,7 +1338,10 @@ void FileJournal::do_aio_write(bufferlist& bl)
     assert(pos == header.max_size);
     if (hbp.length()) {
       // be sneaky: include the header in the second fragment
-      second.push_front(hbp);
+      bufferlist tmp;
+      tmp.push_back(hbp);
+      tmp.claim_append(second);
+      second.swap(tmp);
       pos = 0;          // we included the header
     } else
       pos = get_top();  // no header, start after that