]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados/ObjectOperation: add new function set_op_flags2
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 11 Dec 2014 05:53:52 +0000 (13:53 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Fri, 12 Dec 2014 06:23:34 +0000 (14:23 +0800)
After adding four read/write fadvise flags OP_FADVISE_*, those flags
can set multi flags at the same time. For compatibility, add new
function. The old func set_op_flags will be deprecated.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/include/rados/librados.hpp
src/librados/librados.cc
src/rgw/rgw_rados.cc

index 93b64b6ba1042bad13f871fa4d3322cf94c26274..e4ab6ff1a69a2c763db053c5f203397e9215fedb 100644 (file)
@@ -241,7 +241,9 @@ namespace librados
     virtual ~ObjectOperation();
 
     size_t size();
-    void set_op_flags(ObjectOperationFlags flags);
+    void set_op_flags(ObjectOperationFlags flags) __attribute__((deprecated));
+    //flag mean ObjectOperationFlags
+    void set_op_flags2(int flags);
 
     void cmpxattr(const char *name, uint8_t op, const bufferlist& val);
     void cmpxattr(const char *name, uint8_t op, uint64_t v);
index 8200292eb4823ce7faed6e48c600e1f5ad47e985..cad285e7477664570afc2442bc54c980ca69c920 100644 (file)
@@ -99,12 +99,19 @@ static void set_op_flags(::ObjectOperation *o, int flags)
   o->set_last_op_flags(rados_flags);
 }
 
+//deprcated
 void librados::ObjectOperation::set_op_flags(ObjectOperationFlags flags)
 {
   ::ObjectOperation *o = (::ObjectOperation *)impl;
   ::set_op_flags(o, (int)flags);
 }
 
+void librados::ObjectOperation::set_op_flags2(int flags)
+{
+  ::ObjectOperation *o = (::ObjectOperation *)impl;
+  ::set_op_flags(o, flags);
+}
+
 void librados::ObjectOperation::cmpxattr(const char *name, uint8_t op, const bufferlist& v)
 {
   ::ObjectOperation *o = (::ObjectOperation *)impl;
index 2c53454389be01178e5b1783eef493fd4757bfe6..52222274001d07f38d63abb888d36f271b5f763b 100644 (file)
@@ -4508,7 +4508,7 @@ int RGWRados::clone_objs_impl(void *ctx, rgw_obj& dst_obj,
   ObjectWriteOperation op;
   if (truncate_dest) {
     op.remove();
-    op.set_op_flags(OP_FAILOK); // don't fail if object didn't exist
+    op.set_op_flags2((int)OP_FAILOK); // don't fail if object didn't exist
   }
 
   op.create(exclusive);