]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: commit journal op events immediately 6625/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 20 Nov 2015 13:44:53 +0000 (08:44 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 20 Nov 2015 13:44:53 +0000 (08:44 -0500)
Op events are split into a start and finish record, so they can
be immediately marked as committed within the journal.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/Journal.cc

index 5b610988672859958057895ac12c00d6da36bfae..d83438c60235f1c47c72c36518a75eccf388968d 100644 (file)
@@ -318,17 +318,20 @@ uint64_t Journal::append_op_event(journal::EventEntry &event_entry) {
 
     bufferlist bl;
     ::encode(event_entry, bl);
-    m_journaler->append("", bl);
+    m_journaler->committed(m_journaler->append("", bl));
   }
 
   CephContext *cct = m_image_ctx.cct;
-  ldout(cct, 20) << this << " " << __func__ << ": "
+  ldout(cct, 10) << this << " " << __func__ << ": "
                  << "event=" << event_entry.get_event_type() << ", "
                  << "tid=" << tid << dendl;
   return tid;
 }
 
 void Journal::commit_op_event(uint64_t tid, int r) {
+  CephContext *cct = m_image_ctx.cct;
+  ldout(cct, 10) << this << " " << __func__ << ": tid=" << tid << dendl;
+
   journal::EventEntry event_entry((journal::OpFinishEvent(tid, r)));
 
   bufferlist bl;
@@ -338,7 +341,7 @@ void Journal::commit_op_event(uint64_t tid, int r) {
     Mutex::Locker locker(m_lock);
     assert(m_state == STATE_RECORDING);
 
-    m_journaler->append("", bl);
+    m_journaler->committed(m_journaler->append("", bl));
   }
 }