]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc: Add write method with truncate parameters
authorLi Wang <liwang@ubuntukylin.com>
Wed, 27 Nov 2013 12:56:45 +0000 (20:56 +0800)
committerYunchuan Wen <yunchuanwen@ubuntukylin.com>
Mon, 27 Jan 2014 07:24:58 +0000 (15:24 +0800)
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
src/osdc/Objecter.h

index 508cc379cb8e0e449ea36e98da498e3eaf929f84..3ed112b10a9f5532310da94645a42ad337bd4cd0 100644 (file)
@@ -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);