From: Jason Dillaman Date: Fri, 20 Nov 2015 13:44:53 +0000 (-0500) Subject: librbd: commit journal op events immediately X-Git-Tag: v10.0.2~193^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=93598473ebe9057322df85c09e2f69e3867b566b;p=ceph.git librbd: commit journal op events immediately 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 --- diff --git a/src/librbd/Journal.cc b/src/librbd/Journal.cc index 5b610988672..d83438c6023 100644 --- a/src/librbd/Journal.cc +++ b/src/librbd/Journal.cc @@ -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)); } }