]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: Translate operation flags from C APIs 3930/head
authorMatt Richards <mattjrichards@gmail.com>
Thu, 8 Jan 2015 21:16:17 +0000 (13:16 -0800)
committerLoic Dachary <ldachary@redhat.com>
Tue, 10 Mar 2015 22:29:50 +0000 (23:29 +0100)
The operation flags in the public C API are a distinct enum
and need to be translated to Ceph OSD flags, like as happens in
the C++ API. It seems like the C enum and the C++ enum consciously
use the same values, so I reused the C++ translation function.

Signed-off-by: Matthew Richards <mattjrichards@gmail.com>
(cherry picked from commit 49d114f1fff90e5c0f206725a5eb82c0ba329376)

Conflicts:
src/librados/librados.cc
        comes from lttng tracepoints introduced after firefly

src/librados/librados.cc

index 26b94bd591b8e4318e396b5b45af5610fca8032e..9a6e9f4c9fe9b8b30e6aeeced5cbc1449e7a7550 100644 (file)
@@ -3309,7 +3309,7 @@ extern "C" int rados_write_op_operate(rados_write_op_t write_op,
   object_t obj(oid);
   ::ObjectOperation *oo = (::ObjectOperation *) write_op;
   librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
-  return ctx->operate(obj, oo, mtime, flags);
+  return ctx->operate(obj, oo, mtime, translate_flags(flags));
 }
 
 extern "C" int rados_aio_write_op_operate(rados_write_op_t write_op,
@@ -3323,7 +3323,7 @@ extern "C" int rados_aio_write_op_operate(rados_write_op_t write_op,
   ::ObjectOperation *oo = (::ObjectOperation *) write_op;
   librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
   librados::AioCompletionImpl *c = (librados::AioCompletionImpl*)completion;
-  return ctx->aio_operate(obj, oo, c, ctx->snapc, flags);
+  return ctx->aio_operate(obj, oo, c, ctx->snapc, translate_flags(flags));
 }
 
 extern "C" rados_read_op_t rados_create_read_op()
@@ -3596,7 +3596,8 @@ extern "C" int rados_read_op_operate(rados_read_op_t read_op,
 {
   object_t obj(oid);
   librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
-  return ctx->operate_read(obj, (::ObjectOperation *)read_op, NULL, flags);
+  return ctx->operate_read(obj, (::ObjectOperation *)read_op, NULL,
+                          translate_flags(flags));
 }
 
 extern "C" int rados_aio_read_op_operate(rados_read_op_t read_op,
@@ -3609,5 +3610,5 @@ extern "C" int rados_aio_read_op_operate(rados_read_op_t read_op,
   librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
   librados::AioCompletionImpl *c = (librados::AioCompletionImpl*)completion;
   return ctx->aio_operate_read(obj, (::ObjectOperation *)read_op,
-                              c, flags, NULL);
+                              c, translate_flags(flags), NULL);
 }