]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
skip copyup if write is write_full 6403/head
authorxinxin shu <xinxin.shu@intel.com>
Fri, 30 Oct 2015 09:38:16 +0000 (17:38 +0800)
committerxinxin shu <xinxin.shu@intel.com>
Fri, 6 Nov 2015 01:02:06 +0000 (09:02 +0800)
Signed-off-by: xinxin shu <xinxin.shu@intel.com>
src/librbd/AioRequest.cc
src/librbd/AioRequest.h

index 74c000ce2db3dee761a54a995539ef7d0186ed24..421209a1ae779a9daa2a69fbc064c7e3587bd587 100644 (file)
@@ -530,6 +530,18 @@ namespace librbd {
     }
     wr->set_op_flags2(m_op_flags);
   }
+  void AioWrite::send_write() {
+    bool write_full = (m_object_off == 0 && m_object_len == m_ictx->get_object_size());
+    ldout(m_ictx->cct, 20) << "send_write " << this << " " << m_oid << " "
+                          << m_object_off << "~" << m_object_len
+                           << " object exist " << m_object_exist
+                          << " write_full " << write_full << dendl;
+    if (write_full) {
+      send_write_op(false);
+    } else {
+      AbstractWrite::send_write();
+    }
+  }
 
   void AioRemove::guard_write() {
     // do nothing to disable write guard only if deep-copyup not required
index 2032aef0ba80cdf8fa076dbda3f28820308bdbdb..341b3d60b7d435b03c69c309aee0ce25c1e34637 100644 (file)
@@ -219,6 +219,7 @@ namespace librbd {
     virtual void pre_object_map_update(uint8_t *new_state) {
       *new_state = OBJECT_EXISTS;
     }
+    virtual void send_write();
 
   private:
     ceph::bufferlist m_write_data;