]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: only send non-zero copyup data
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 10 May 2013 00:05:20 +0000 (17:05 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Fri, 10 May 2013 23:17:10 +0000 (16:17 -0700)
If the parent image is logically zero for the range of a child object,
it's equivalent to the object not existing. Save some I/O and network
bandwidth and don't send the useless zeroes.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/librbd/AioRequest.cc

index 8d4d98c0bd0f150194d551e050be1dfd51ac552a..83e19272f8d2fbc44d8aa7f0caa10b5aaa5176be 100644 (file)
@@ -234,7 +234,8 @@ namespace librbd {
   }
 
   void AbstractWrite::send_copyup() {
-    m_copyup.exec("rbd", "copyup", m_read_data);
+    if (!m_read_data.is_zero())
+      m_copyup.exec("rbd", "copyup", m_read_data);
     add_copyup_ops();
 
     librados::AioCompletion *rados_completion =