@@ -2915,6 +2915,7 @@ int RGWRados::swift_versioning_copy(RGWObjectCtx& obj_ctx,
29152915 jspan_context no_trace{false , false };
29162916
29172917 r = copy_obj (obj_ctx,
2918+ obj_ctx, /* src and dest share an obj_ctx */
29182919 owner,
29192920 remote_user,
29202921 NULL , /* req_info *info */
@@ -3014,6 +3015,7 @@ int RGWRados::swift_versioning_restore(RGWObjectCtx& obj_ctx,
30143015 jspan_context no_trace{false , false };
30153016
30163017 int ret = copy_obj (obj_ctx,
3018+ obj_ctx, /* src and dest share an obj_ctx */
30173019 owner,
30183020 remote_user,
30193021 nullptr , /* req_info *info */
@@ -4154,7 +4156,7 @@ int RGWFetchObjFilter_Default::filter(CephContext *cct,
41544156 return 0 ;
41554157}
41564158
4157- int RGWRados::fetch_remote_obj (RGWObjectCtx& obj_ctx ,
4159+ int RGWRados::fetch_remote_obj (RGWObjectCtx& dest_obj_ctx ,
41584160 const rgw_user& user_id,
41594161 req_info *info,
41604162 const rgw_zone_id& source_zone,
@@ -4206,7 +4208,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
42064208 using namespace rgw ::putobj;
42074209 jspan_context no_trace{false , false };
42084210 AtomicObjectProcessor processor (&aio, this , dest_bucket_info, nullptr ,
4209- owner, obj_ctx , dest_obj, olh_epoch,
4211+ owner, dest_obj_ctx , dest_obj, olh_epoch,
42104212 tag, rctx.dpp , rctx.y , no_trace);
42114213 RGWRESTConn *conn;
42124214 auto & zone_conn_map = svc.zone ->get_zone_conn_map ();
@@ -4290,7 +4292,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
42904292
42914293 if (copy_if_newer) {
42924294 /* need to get mtime for destination */
4293- ret = get_obj_state (rctx.dpp , &obj_ctx , dest_bucket_info, stat_dest_obj, &dest_state, &manifest, stat_follow_olh, rctx.y );
4295+ ret = get_obj_state (rctx.dpp , &dest_obj_ctx , dest_bucket_info, stat_dest_obj, &dest_state, &manifest, stat_follow_olh, rctx.y );
42944296 if (ret < 0 )
42954297 goto set_err_state;
42964298
@@ -4499,8 +4501,8 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
44994501
45004502 if (copy_if_newer && canceled) {
45014503 ldpp_dout (rctx.dpp , 20 ) << " raced with another write of obj: " << dest_obj << dendl;
4502- obj_ctx .invalidate (dest_obj); /* object was overwritten */
4503- ret = get_obj_state (rctx.dpp , &obj_ctx , dest_bucket_info, stat_dest_obj, &dest_state, &manifest, stat_follow_olh, rctx.y );
4504+ dest_obj_ctx .invalidate (dest_obj); /* object was overwritten */
4505+ ret = get_obj_state (rctx.dpp , &dest_obj_ctx , dest_bucket_info, stat_dest_obj, &dest_state, &manifest, stat_follow_olh, rctx.y );
45044506 if (ret < 0 ) {
45054507 ldpp_dout (rctx.dpp , 0 ) << " ERROR: " << __func__ << " : get_err_state() returned ret=" << ret << dendl;
45064508 goto set_err_state;
@@ -4534,7 +4536,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
45344536 // for OP_LINK_OLH to call set_olh() with a real olh_epoch
45354537 if (olh_epoch && *olh_epoch > 0 ) {
45364538 constexpr bool log_data_change = true ;
4537- ret = set_olh (rctx.dpp , obj_ctx , dest_bucket_info, dest_obj, false , nullptr ,
4539+ ret = set_olh (rctx.dpp , dest_obj_ctx , dest_bucket_info, dest_obj, false , nullptr ,
45384540 *olh_epoch, real_time (), false , rctx.y , zones_trace, log_data_change);
45394541 } else {
45404542 // we already have the latest copy
@@ -4609,7 +4611,8 @@ int RGWRados::copy_obj_to_remote_dest(const DoutPrefixProvider *dpp,
46094611 * err: stores any errors resulting from the get of the original object
46104612 * Returns: 0 on success, -ERR# otherwise.
46114613 */
4612- int RGWRados::copy_obj (RGWObjectCtx& obj_ctx,
4614+ int RGWRados::copy_obj (RGWObjectCtx& src_obj_ctx,
4615+ RGWObjectCtx& dest_obj_ctx,
46134616 const ACLOwner& owner,
46144617 const rgw_user& remote_user,
46154618 req_info *info,
@@ -4670,7 +4673,7 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
46704673 if (remote_src || !source_zone.empty ()) {
46714674 rgw_zone_set_entry source_trace_entry{source_zone.id , std::nullopt };
46724675 const req_context rctx{dpp, y, nullptr };
4673- return fetch_remote_obj (obj_ctx , remote_user, info, source_zone,
4676+ return fetch_remote_obj (dest_obj_ctx , remote_user, info, source_zone,
46744677 dest_obj, src_obj, dest_bucket_info, &src_bucket_info,
46754678 dest_placement, src_mtime, mtime, mod_ptr,
46764679 unmod_ptr, high_precision_time,
@@ -4680,7 +4683,7 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
46804683 }
46814684
46824685 map<string, bufferlist> src_attrs;
4683- RGWRados::Object src_op_target (this , src_bucket_info, obj_ctx , src_obj);
4686+ RGWRados::Object src_op_target (this , src_bucket_info, src_obj_ctx , src_obj);
46844687 RGWRados::Object::Read read_op (&src_op_target);
46854688
46864689 read_op.conds .mod_ptr = mod_ptr;
@@ -4741,7 +4744,7 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
47414744 RGWObjManifest *amanifest = nullptr ;
47424745
47434746 constexpr bool follow_olh = true ;
4744- ret = get_obj_state (dpp, &obj_ctx , src_bucket_info, src_obj,
4747+ ret = get_obj_state (dpp, &src_obj_ctx , src_bucket_info, src_obj,
47454748 &astate, &amanifest, follow_olh, y);
47464749 if (ret < 0 ) {
47474750 return ret;
@@ -4818,7 +4821,7 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
48184821
48194822 if (copy_data) { /* refcounting tail wouldn't work here, just copy the data */
48204823 attrs.erase (RGW_ATTR_TAIL_TAG);
4821- return copy_obj_data (obj_ctx , owner, dest_bucket_info, dest_placement, read_op, obj_size - 1 , dest_obj,
4824+ return copy_obj_data (dest_obj_ctx , owner, dest_bucket_info, dest_placement, read_op, obj_size - 1 , dest_obj,
48224825 mtime, real_time (), attrs, olh_epoch, delete_at, petag, dpp, y);
48234826 }
48244827
@@ -4835,7 +4838,7 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
48354838 RGWObjManifest *pmanifest;
48364839 ldpp_dout (dpp, 20 ) << " dest_obj=" << dest_obj << " src_obj=" << src_obj << " copy_itself=" << (int )copy_itself << dendl;
48374840
4838- RGWRados::Object dest_op_target (this , dest_bucket_info, obj_ctx , dest_obj);
4841+ RGWRados::Object dest_op_target (this , dest_bucket_info, dest_obj_ctx , dest_obj);
48394842 RGWRados::Object::Write write_op (&dest_op_target);
48404843
48414844 string tag;
0 commit comments