]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: implement cls_cxx_write2().
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 27 Aug 2019 19:31:07 +0000 (21:31 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 13 Sep 2019 18:28:09 +0000 (20:28 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/objclass.cc

index a3fdb5e43d84f657eff83de763132e7a72af1736..417d69135a84fcdf45b7cdcddeb4c69087d22804 100644 (file)
@@ -142,7 +142,17 @@ int cls_cxx_write2(cls_method_context_t hctx,
                    bufferlist *inbl,
                    uint32_t op_flags)
 {
-  return 0;
+  OSDOp op{ CEPH_OSD_OP_WRITE };
+  op.op.extent.offset = ofs;
+  op.op.extent.length = len;
+  op.op.flags = op_flags;
+  op.indata = *inbl;
+  try {
+    reinterpret_cast<ceph::osd::OpsExecuter*>(hctx)->do_osd_op(op).get();
+    return 0;
+  } catch (ceph::osd::error& e) {
+    return -e.code().value();
+  }
 }
 
 int cls_cxx_write_full(cls_method_context_t hctx, bufferlist * const inbl)