]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: rados_aio_write_op_operate() propagates mtime
authorCasey Bodley <cbodley@redhat.com>
Tue, 23 May 2023 16:56:03 +0000 (12:56 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 19 Jun 2023 18:33:43 +0000 (14:33 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 0bfb144ee64fe9ecd3f27cf94fca832e3ab3b39b)

src/librados/librados_c.cc

index c2a47d94c8fbc41ff706b827ab76a60120c424c0..77fc461467af0956ee97ce69113f5f8052528e9e 100644 (file)
@@ -4020,10 +4020,16 @@ extern "C" int LIBRADOS_C_API_DEFAULT_F(rados_aio_write_op_operate)(
 {
   tracepoint(librados, rados_aio_write_op_operate_enter, write_op, io, completion, oid, mtime, flags);
   object_t obj(oid);
-  ::ObjectOperation *oo = to_object_operation(write_op);
+  auto oimpl = static_cast<librados::ObjectOperationImpl*>(write_op);
   librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
   librados::AioCompletionImpl *c = (librados::AioCompletionImpl*)completion;
-  int retval = ctx->aio_operate(obj, oo, c, ctx->snapc, nullptr, translate_flags(flags));
+
+  if (mtime) {
+    oimpl->rt = ceph::real_clock::from_time_t(*mtime);
+    oimpl->prt = &oimpl->rt;
+  }
+
+  int retval = ctx->aio_operate(obj, &oimpl->o, c, ctx->snapc, oimpl->prt, translate_flags(flags));
   tracepoint(librados, rados_aio_write_op_operate_exit, retval);
   return retval;
 }