From: Sage Weil Date: Fri, 12 Aug 2016 20:04:02 +0000 (-0400) Subject: os/bluestore/BlueFS: allow log position to when doing op_jump X-Git-Tag: ses5-milestone5~93^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bec2b06e9845f0dc0c4eb27d10de9e7d2e7f7a18;p=ceph.git os/bluestore/BlueFS: allow log position to when doing op_jump Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index eeef01fec699..6665060c2b6c 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -1078,7 +1078,8 @@ void BlueFS::_pad_bl(bufferlist& bl) } int BlueFS::_flush_and_sync_log(std::unique_lock& l, - uint64_t want_seq) + uint64_t want_seq, + uint64_t jump_to) { while (log_flushing) { dout(10) << __func__ << " want_seq " << want_seq @@ -1130,6 +1131,13 @@ int BlueFS::_flush_and_sync_log(std::unique_lock& l, int r = _flush(log_writer, true); assert(r == 0); + if (jump_to) { + dout(10) << __func__ << " jumping log offset from 0x" << std::hex + << log_writer->pos << " -> 0x" << jump_to << std::dec << dendl; + log_writer->pos = jump_to; + log_writer->file->fnode.size = jump_to; + } + // drop lock while we wait for io l.unlock(); wait_for_aio(log_writer); diff --git a/src/os/bluestore/BlueFS.h b/src/os/bluestore/BlueFS.h index d7a1a809796b..9bb82e63493a 100644 --- a/src/os/bluestore/BlueFS.h +++ b/src/os/bluestore/BlueFS.h @@ -239,7 +239,8 @@ private: int _fsync(FileWriter *h, std::unique_lock& l); int _flush_and_sync_log(std::unique_lock& l, - uint64_t want_seq = 0); + uint64_t want_seq = 0, + uint64_t jump_to = 0); uint64_t _estimate_log_size(); bool _should_compact_log(); void _compact_log_sync();