]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: enable async calls to time_log_trim
authorCasey Bodley <cbodley@redhat.com>
Wed, 8 Jun 2016 19:17:55 +0000 (15:17 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 22 Jan 2018 20:43:14 +0000 (15:43 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d67436bb0d6cb9ae7757916547b8274990f8cc6b)

src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index a7d77bbd19eb9a14c0b14ec06362d257a152ee8e..9eeeb01fa2cf6362d0cdae109807b34ae6f29dd8 100644 (file)
@@ -4782,7 +4782,8 @@ int RGWRados::time_log_info_async(librados::IoCtx& io_ctx, const string& oid, cl
 }
 
 int RGWRados::time_log_trim(const string& oid, const real_time& start_time, const real_time& end_time,
-                           const string& from_marker, const string& to_marker)
+                           const string& from_marker, const string& to_marker,
+                            librados::AioCompletion *completion)
 {
   librados::IoCtx io_ctx;
 
@@ -4795,7 +4796,15 @@ int RGWRados::time_log_trim(const string& oid, const real_time& start_time, cons
   utime_t st(start_time);
   utime_t et(end_time);
 
-  return cls_log_trim(io_ctx, oid, st, et, from_marker, to_marker);
+  ObjectWriteOperation op;
+  cls_log_trim(op, st, et, from_marker, to_marker);
+
+  if (!completion) {
+    r = io_ctx.operate(oid, &op);
+  } else {
+    r = io_ctx.aio_operate(oid, completion, &op);
+  }
+  return r;
 }
 
 string RGWRados::objexp_hint_get_shardname(int shard_num)
index 281bdab866652595160ab2f08221183bb8303fa0..7c4745ca2d682d2861a0f5d294961b2f072d13af 100644 (file)
@@ -2911,7 +2911,8 @@ public:
   int time_log_info(const string& oid, cls_log_header *header);
   int time_log_info_async(librados::IoCtx& io_ctx, const string& oid, cls_log_header *header, librados::AioCompletion *completion);
   int time_log_trim(const string& oid, const ceph::real_time& start_time, const ceph::real_time& end_time,
-                    const string& from_marker, const string& to_marker);
+                    const string& from_marker, const string& to_marker,
+                    librados::AioCompletion *completion = nullptr);
 
   string objexp_hint_get_shardname(int shard_num);
   int objexp_key_shard(const rgw_obj_key& key);