From: Li Wang Date: Wed, 27 Nov 2013 12:56:45 +0000 (+0800) Subject: osdc: Add write method with truncate parameters X-Git-Tag: v0.78~234^2^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0f00f07d64811c34b36b709c96a25a6ae7446bb8;p=ceph.git osdc: Add write method with truncate parameters Signed-off-by: Yunchuan Wen Signed-off-by: Li Wang --- diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 508cc379cb8e..3ed112b10a9f 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -279,8 +279,16 @@ struct ObjectOperation { out_handler[p] = h; out_rval[p] = prval; } - void write(uint64_t off, bufferlist& bl) { + void write(uint64_t off, bufferlist& bl, + uint64_t truncate_size, + uint32_t truncate_seq) { add_data(CEPH_OSD_OP_WRITE, off, bl.length(), bl); + OSDOp& o = *ops.rbegin(); + o.op.extent.truncate_size = truncate_size; + o.op.extent.truncate_seq = truncate_seq; + } + void write(uint64_t off, bufferlist& bl) { + write(off, bl, 0, 0); } void write_full(bufferlist& bl) { add_data(CEPH_OSD_OP_WRITEFULL, 0, bl.length(), bl);