From: Casey Bodley Date: Wed, 8 Jun 2016 19:17:55 +0000 (-0400) Subject: rgw: enable async calls to time_log_trim X-Git-Tag: v11.0.1~24^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d67436bb0d6cb9ae7757916547b8274990f8cc6b;p=ceph.git rgw: enable async calls to time_log_trim Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index f05b0a139cb..0b3b7ec1b3c 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4621,7 +4621,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; @@ -4634,7 +4635,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) diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 91eab4bedf5..b4e43c4d951 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -2826,7 +2826,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);