]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueFS: allow log position to when doing op_jump
authorSage Weil <sage@redhat.com>
Fri, 12 Aug 2016 20:04:02 +0000 (16:04 -0400)
committerSage Weil <sage@redhat.com>
Sat, 13 Aug 2016 15:49:12 +0000 (11:49 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h

index eeef01fec6990c367504eb65c8c2be98856f469a..6665060c2b6c1d4ec0180a6060ab068ea5cf70a0 100644 (file)
@@ -1078,7 +1078,8 @@ void BlueFS::_pad_bl(bufferlist& bl)
 }
 
 int BlueFS::_flush_and_sync_log(std::unique_lock<std::mutex>& 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<std::mutex>& 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);
index d7a1a809796b84f50b2e400749b954adba2bdb86..9bb82e63493a52a59da483ab7c3211136079b077 100644 (file)
@@ -239,7 +239,8 @@ private:
   int _fsync(FileWriter *h, std::unique_lock<std::mutex>& l);
 
   int _flush_and_sync_log(std::unique_lock<std::mutex>& 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();