From 2760e440028738fcc5e820c9b7cc9f8e1a19ecbd Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 12 Sep 2018 09:03:29 -0400 Subject: [PATCH] rgw: remove unused opstate params from copy/fetch/stat Signed-off-by: Casey Bodley --- src/rgw/rgw_cr_rados.cc | 8 -------- src/rgw/rgw_op.cc | 2 -- src/rgw/rgw_op.h | 2 -- src/rgw/rgw_rados.cc | 17 +---------------- src/rgw/rgw_rados.h | 6 ------ src/rgw/rgw_rest_s3.cc | 13 ------------- 6 files changed, 1 insertion(+), 47 deletions(-) diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index 7179b572505..f39d760e8d4 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -550,8 +550,6 @@ int RGWAsyncFetchRemoteObj::_send_request() string user_id; char buf[16]; snprintf(buf, sizeof(buf), ".%lld", (long long)store->instance_id()); - string client_id = store->zone_id() + buf; - string op_id = store->unique_id(store->get_new_req_id()); map attrs; rgw_obj src_obj(bucket_info.bucket, key); @@ -560,9 +558,6 @@ int RGWAsyncFetchRemoteObj::_send_request() int r = store->fetch_remote_obj(obj_ctx, user_id, - client_id, - op_id, - false, /* don't record op state in ops log */ NULL, /* req_info */ source_zone, dest_obj, @@ -602,8 +597,6 @@ int RGWAsyncStatRemoteObj::_send_request() string user_id; char buf[16]; snprintf(buf, sizeof(buf), ".%lld", (long long)store->instance_id()); - string client_id = store->zone_id() + buf; - string op_id = store->unique_id(store->get_new_req_id()); rgw_obj src_obj(bucket_info.bucket, key); @@ -611,7 +604,6 @@ int RGWAsyncStatRemoteObj::_send_request() int r = store->stat_remote_obj(obj_ctx, user_id, - client_id, nullptr, /* req_info */ source_zone, src_obj, diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 3267060276b..5d8ecafe323 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -4842,8 +4842,6 @@ void RGWCopyObj::execute() op_ret = store->copy_obj(obj_ctx, s->user->user_id, - client_id, - op_id, &s->info, source_zone, dst_obj, diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index ea590fa97d4..5cd73b2c3d4 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -1314,8 +1314,6 @@ protected: RGWBucketInfo src_bucket_info; RGWBucketInfo dest_bucket_info; string source_zone; - string client_id; - string op_id; string etag; off_t last_ofs; diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index d7fe958eb8b..3d6a857a4ea 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -6928,9 +6928,6 @@ int RGWRados::swift_versioning_copy(RGWObjectCtx& obj_ctx, return 0; } - string client_id; - string op_id; - const string& src_name = obj.get_oid(); char buf[src_name.size() + 32]; struct timespec ts = ceph::real_clock::to_timespec(state->mtime); @@ -6959,8 +6956,6 @@ int RGWRados::swift_versioning_copy(RGWObjectCtx& obj_ctx, r = copy_obj(obj_ctx, user, - client_id, - op_id, NULL, /* req_info *info */ no_zone, dest_obj, @@ -7025,8 +7020,6 @@ int RGWRados::swift_versioning_restore(RGWObjectCtx& obj_ctx, /* This code will be executed on latest version of the object. */ const auto handler = [&](const rgw_bucket_dir_entry& entry) -> int { - std::string no_client_id; - std::string no_op_id; std::string no_zone; /* We don't support object versioning of Swift API on those buckets that @@ -7048,8 +7041,6 @@ int RGWRados::swift_versioning_restore(RGWObjectCtx& obj_ctx, int ret = copy_obj(obj_ctx, user, - no_client_id, - no_op_id, nullptr, /* req_info *info */ no_zone, obj, /* dest obj */ @@ -7861,7 +7852,6 @@ public: int RGWRados::stat_remote_obj(RGWObjectCtx& obj_ctx, const rgw_user& user_id, - const string& client_id, req_info *info, const string& source_zone, rgw_obj& src_obj, @@ -7974,9 +7964,6 @@ int RGWRados::stat_remote_obj(RGWObjectCtx& obj_ctx, int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx, const rgw_user& user_id, - const string& client_id, - const string& op_id, - bool record_op_state, req_info *info, const string& source_zone, rgw_obj& dest_obj, @@ -8261,8 +8248,6 @@ int RGWRados::copy_obj_to_remote_dest(RGWObjState *astate, */ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx, const rgw_user& user_id, - const string& client_id, - const string& op_id, req_info *info, const string& source_zone, rgw_obj& dest_obj, @@ -8310,7 +8295,7 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx, ldout(cct, 5) << "Copy object " << src_obj.bucket << ":" << src_obj.get_oid() << " => " << dest_obj.bucket << ":" << dest_obj.get_oid() << dendl; if (remote_src || !source_zone.empty()) { - return fetch_remote_obj(obj_ctx, user_id, client_id, op_id, true, info, source_zone, + return fetch_remote_obj(obj_ctx, user_id, info, source_zone, dest_obj, src_obj, dest_bucket_info, src_bucket_info, src_mtime, mtime, mod_ptr, unmod_ptr, high_precision_time, if_match, if_nomatch, attrs_mod, copy_if_newer, attrs, category, diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 463a35446b5..2fd0af6033b 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -3153,7 +3153,6 @@ public: int stat_remote_obj(RGWObjectCtx& obj_ctx, const rgw_user& user_id, - const string& client_id, req_info *info, const string& source_zone, rgw_obj& src_obj, @@ -3173,9 +3172,6 @@ public: int fetch_remote_obj(RGWObjectCtx& obj_ctx, const rgw_user& user_id, - const string& client_id, - const string& op_id, - bool record_op_state, req_info *info, const string& source_zone, rgw_obj& dest_obj, @@ -3217,8 +3213,6 @@ public: */ int copy_obj(RGWObjectCtx& obj_ctx, const rgw_user& user_id, - const string& client_id, - const string& op_id, req_info *info, const string& source_zone, rgw_obj& dest_obj, diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index deca9cea961..0e25e10e2f9 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -2125,19 +2125,6 @@ int RGWCopyObj_ObjStore_S3::get_params() if (s->system_request) { source_zone = s->info.args.get(RGW_SYS_PARAM_PREFIX "source-zone"); s->info.args.get_bool(RGW_SYS_PARAM_PREFIX "copy-if-newer", ©_if_newer, false); - if (!source_zone.empty()) { - client_id = s->info.args.get(RGW_SYS_PARAM_PREFIX "client-id"); - op_id = s->info.args.get(RGW_SYS_PARAM_PREFIX "op-id"); - - if (client_id.empty() || op_id.empty()) { - ldout(s->cct, 0) << - RGW_SYS_PARAM_PREFIX "client-id or " - RGW_SYS_PARAM_PREFIX "op-id were not provided, " - "required for intra-region copy" - << dendl; - return -EINVAL; - } - } } copy_source = s->info.env->get("HTTP_X_AMZ_COPY_SOURCE"); -- 2.39.5