]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: use append(bufferlist &) to avoid unnecessary copy 12272/head
authorYunchuan Wen <yunchuan.wen@kylin-cloud.com>
Fri, 2 Dec 2016 07:04:37 +0000 (15:04 +0800)
committerYunchuan Wen <yunchuan.wen@kylin-cloud.com>
Tue, 18 Apr 2017 06:28:34 +0000 (06:28 +0000)
buffer::list::c_str() will rebuild itself if it isn't
contiguous, and append(char *) will do copy from the ptr.

Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
src/osd/PrimaryLogPG.cc

index 71846caabf80eeb4b8938caa014b71c05cf11023..0294076c0f7e514646f729222f24875a4aafe975 100644 (file)
@@ -3801,7 +3801,7 @@ int PrimaryLogPG::do_writesame(OpContext *ctx, OSDOp& osd_op)
   }
 
   while (write_length) {
-    write_op.indata.append(osd_op.indata.c_str(), op.writesame.data_length);
+    write_op.indata.append(osd_op.indata);
     write_length -= op.writesame.data_length;
   }