]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: include actual write op type in AbstractWrite debug output
authorJason Dillaman <dillaman@redhat.com>
Fri, 8 May 2015 18:32:04 +0000 (14:32 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 5 Jun 2015 15:46:30 +0000 (11:46 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Conflicts:
src/librbd/AioRequest.cc

src/librbd/AioRequest.cc
src/librbd/AioRequest.h

index 77ead571a4b4e1273c6e1b2568afd4f7a62a4198..3e7fdf98b106e712888793e9cc64be9126fa0a3e 100644 (file)
@@ -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();
   }
 
index 4fff5ef8b91cbdcbc614cef9a444ccb5433ed9a5..60b2b02d5ec4badaeadc4928170d28664c6ed67a 100644 (file)
@@ -179,6 +179,7 @@ namespace librbd {
     std::vector<librados::snap_t> 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;
     }