From: Sage Weil Date: Tue, 3 Apr 2018 15:06:19 +0000 (-0500) Subject: os/filestore/FileJournal: avoid push_front X-Git-Tag: v13.1.0~388^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7c701962bba8e2ee1bfbb73cea588df397350117;p=ceph.git os/filestore/FileJournal: avoid push_front Signed-off-by: Sage Weil --- diff --git a/src/os/filestore/FileJournal.cc b/src/os/filestore/FileJournal.cc index e52ed031d087..0c0940dc506d 100644 --- a/src/os/filestore/FileJournal.cc +++ b/src/os/filestore/FileJournal.cc @@ -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