From: Jason Dillaman Date: Fri, 8 May 2015 18:32:04 +0000 (-0400) Subject: librbd: include actual write op type in AbstractWrite debug output X-Git-Tag: v9.0.2~13^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=336c3bfb00f8ce2b36cc5180e6d6e830579ab4f9;p=ceph.git librbd: include actual write op type in AbstractWrite debug output Signed-off-by: Jason Dillaman Conflicts: src/librbd/AioRequest.cc --- diff --git a/src/librbd/AioRequest.cc b/src/librbd/AioRequest.cc index 77ead571a4b4..3e7fdf98b106 100644 --- a/src/librbd/AioRequest.cc +++ b/src/librbd/AioRequest.cc @@ -299,8 +299,8 @@ namespace librbd { bool AbstractWrite::should_complete(int r) { - ldout(m_ictx->cct, 20) << "write " << this << " " << m_oid << " " - << m_object_off << "~" << m_object_len + ldout(m_ictx->cct, 20) << get_write_type() << " " << this << " " << m_oid + << " " << m_object_off << "~" << m_object_len << " should_complete: r = " << r << dendl; bool finished = true; @@ -385,8 +385,9 @@ namespace librbd { void AbstractWrite::send() { assert(m_ictx->owner_lock.is_locked()); - ldout(m_ictx->cct, 20) << "send " << this << " " << m_oid << " " - << m_object_off << "~" << m_object_len << dendl; + ldout(m_ictx->cct, 20) << "send " << get_write_type() << " " << this <<" " + << m_oid << " " << m_object_off << "~" + << m_object_len << dendl; send_pre(); } diff --git a/src/librbd/AioRequest.h b/src/librbd/AioRequest.h index 4fff5ef8b91c..60b2b02d5ec4 100644 --- a/src/librbd/AioRequest.h +++ b/src/librbd/AioRequest.h @@ -179,6 +179,7 @@ namespace librbd { std::vector m_snaps; virtual void add_write_ops(librados::ObjectWriteOperation *wr) = 0; + virtual const char* get_write_type() const = 0; virtual void guard_write(); virtual void pre_object_map_update(uint8_t *new_state) = 0; virtual bool post_object_map_update() { @@ -208,6 +209,11 @@ namespace librbd { } protected: virtual void add_write_ops(librados::ObjectWriteOperation *wr); + + virtual const char* get_write_type() const { + return "write"; + } + virtual void pre_object_map_update(uint8_t *new_state) { *new_state = OBJECT_EXISTS; } @@ -235,6 +241,12 @@ namespace librbd { } } + virtual const char* get_write_type() const { + if (has_parent()) { + return "remove (trunc)"; + } + return "remove"; + } virtual void pre_object_map_update(uint8_t *new_state) { if (has_parent()) { m_object_state = OBJECT_EXISTS; @@ -274,6 +286,10 @@ namespace librbd { wr->truncate(m_object_off); } + virtual const char* get_write_type() const { + return "truncate"; + } + virtual void pre_object_map_update(uint8_t *new_state) { *new_state = OBJECT_EXISTS; } @@ -294,6 +310,10 @@ namespace librbd { wr->zero(m_object_off, m_object_len); } + virtual const char* get_write_type() const { + return "zero"; + } + virtual void pre_object_map_update(uint8_t *new_state) { *new_state = OBJECT_EXISTS; }