]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
class: implement write_full interface
authorYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 10 Jun 2010 22:26:08 +0000 (15:26 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 10 Jun 2010 22:26:08 +0000 (15:26 -0700)
src/objclass/class_api.cc
src/objclass/objclass.h

index bb0d6de725e2da5e31ec5f7e6d120dde61c7b0f4..2bfe212c983876c64fc8a2aa9db725d0fdc18455 100644 (file)
@@ -195,6 +195,18 @@ int cls_cxx_write(cls_method_context_t hctx, int ofs, int len, bufferlist *inbl)
   return (*pctx)->pg->do_osd_ops(*pctx, ops, outbl);
 }
 
+int cls_cxx_write_full(cls_method_context_t hctx, bufferlist *inbl)
+{
+  ReplicatedPG::OpContext **pctx = (ReplicatedPG::OpContext **)hctx;
+  vector<OSDOp> ops(1);
+  ops[0].op.op = CEPH_OSD_OP_WRITEFULL;
+  ops[0].op.extent.offset = 0;
+  ops[0].op.extent.length = inbl->length();
+  ops[0].data = *inbl;
+  bufferlist outbl;
+  return (*pctx)->pg->do_osd_ops(*pctx, ops, outbl);
+}
+
 int cls_cxx_replace(cls_method_context_t hctx, int ofs, int len, bufferlist *inbl)
 {
   ReplicatedPG::OpContext **pctx = (ReplicatedPG::OpContext **)hctx;
index 911a05129d695eb6a45ebebea67c95f5badc6c9f..ad09f4912f6cac2eba04ff9ffa31b594d4788a25 100644 (file)
@@ -88,6 +88,7 @@ extern int cls_register_cxx_method(cls_handle_t hclass, const char *method, int
 
 extern int cls_cxx_read(cls_method_context_t hctx, int ofs, int len, bufferlist *bl);
 extern int cls_cxx_write(cls_method_context_t hctx, int ofs, int len, bufferlist *bl);
+extern int cls_cxx_write_full(cls_method_context_t hctx, bufferlist *bl);
 extern int cls_cxx_replace(cls_method_context_t hctx, int ofs, int len, bufferlist *bl);
 extern int cls_cxx_snap_revert(cls_method_context_t hctx, snapid_t snapid);