From b2ea8e8f0856ecc1456196c45ebce890f01ac8b3 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 2 Sep 2014 15:46:24 -0700 Subject: [PATCH] rgw: interface adjustment following a rebase Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_admin.cc | 4 ++-- src/rgw/rgw_rados.cc | 13 +++++++------ src/rgw/rgw_rados.h | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 83befef9eb0bc..038b3e28c61ca 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -1934,7 +1934,7 @@ next: } } if (need_rewrite) { - ret = store->rewrite_obj(bucket_info.owner, obj); + ret = store->rewrite_obj(bucket_info, obj); if (ret < 0) { cerr << "ERROR: object rewrite returned: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -2027,7 +2027,7 @@ next: if (!need_rewrite) { formatter->dump_string("status", "Skipped"); } else { - r = store->rewrite_obj(bucket_info.owner, obj); + r = store->rewrite_obj(bucket_info, obj); if (r == 0) { formatter->dump_string("status", "Success"); } else { diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index ad7b06f859912..0323b6db8aeb3 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3196,7 +3196,7 @@ public: } }; -int RGWRados::rewrite_obj(const string& bucket_owner, rgw_obj& obj) +int RGWRados::rewrite_obj(RGWBucketInfo& dest_bucket_info, rgw_obj& obj) { map attrset; off_t ofs = 0; @@ -3223,7 +3223,7 @@ int RGWRados::rewrite_obj(const string& bucket_owner, rgw_obj& obj) return ret; } - return copy_obj_data((void *)&rctx, bucket_owner, &handle, end, obj, obj, max_chunk_size, NULL, mtime, attrset, RGW_OBJ_CATEGORY_MAIN, NULL, NULL, NULL); + return copy_obj_data((void *)&rctx, dest_bucket_info, &handle, end, obj, obj, max_chunk_size, NULL, mtime, attrset, RGW_OBJ_CATEGORY_MAIN, NULL, NULL, NULL); } /** @@ -3452,7 +3452,8 @@ set_err_state: } if (copy_data) { /* refcounting tail wouldn't work here, just copy the data */ - return copy_obj_data(ctx, dest_bucket_info.owner, &handle, end, dest_obj, src_obj, max_chunk_size, mtime, 0, src_attrs, category, ptag, petag, err); + return copy_obj_data(ctx, dest_bucket_info, &handle, end, dest_obj, src_obj, + max_chunk_size, mtime, 0, src_attrs, category, ptag, petag, err); } RGWObjManifest::obj_iterator miter = astate->manifest.obj_begin(); @@ -3566,7 +3567,7 @@ done_ret: int RGWRados::copy_obj_data(void *ctx, - const string& owner, + RGWBucketInfo& dest_bucket_info, void **handle, off_t end, rgw_obj& dest_obj, rgw_obj& src_obj, @@ -3585,8 +3586,8 @@ int RGWRados::copy_obj_data(void *ctx, string tag; append_rand_alpha(cct, tag, tag, 32); - RGWPutObjProcessor_Atomic processor(owner, dest_obj.bucket, dest_obj.get_object(), - cct->_conf->rgw_obj_stripe_size, tag); + RGWPutObjProcessor_Atomic processor(dest_bucket_info.owner, dest_obj.bucket, dest_obj.get_object(), + cct->_conf->rgw_obj_stripe_size, tag, dest_bucket_info.versioning_enabled); int ret = processor.prepare(this, ctx, NULL); if (ret < 0) return ret; diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index e6c12d21ff830..a168109a73ceb 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -314,7 +314,7 @@ public: if (objs.size() == 1) { map::iterator iter = objs.begin(); rgw_obj& obj = iter->second.loc; - return head_obj.object != obj.object; + return !(head_obj == obj); } return (objs.size() >= 2); } @@ -1617,7 +1617,7 @@ public: return clone_objs(ctx, dst_obj, v, attrs, category, pmtime, truncate_dest, exclusive, xattr_cond); } - int rewrite_obj(const string& bucket_owner, rgw_obj& obj); + int rewrite_obj(RGWBucketInfo& dest_bucket_info, rgw_obj& obj); /** * Copy an object. * dest_obj: the object to copy into @@ -1651,7 +1651,7 @@ public: void *progress_data); int copy_obj_data(void *ctx, - const string& owner, + RGWBucketInfo& dest_bucket_info, void **handle, off_t end, rgw_obj& dest_obj, rgw_obj& src_obj, -- 2.39.5