diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index a11b6466c5d62..d79188a8d4460 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -498,7 +498,7 @@ bool RGWOmapAppend::finish() { int RGWAsyncGetBucketInstanceInfo::_send_request() { RGWObjectCtx obj_ctx(store); - int r = store->get_bucket_instance_from_oid(obj_ctx, oid, *bucket_info, NULL, NULL); + int r = store->get_bucket_instance_from_oid(obj_ctx, oid, bucket_info, NULL, NULL); if (r < 0) { ldout(store->ctx(), 0) << "ERROR: failed to get bucket instance info for " << oid << dendl; diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index b18f35b5220b2..42828d4119f0d 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -654,16 +654,15 @@ class RGWShardedOmapCRManager { class RGWAsyncGetBucketInstanceInfo : public RGWAsyncRadosRequest { RGWRados *store; const std::string oid; - RGWBucketInfo *bucket_info; protected: int _send_request() override; public: RGWAsyncGetBucketInstanceInfo(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, - RGWRados *_store, const std::string& oid, - RGWBucketInfo *_bucket_info) - : RGWAsyncRadosRequest(caller, cn), store(_store), - oid(oid), bucket_info(_bucket_info) {} + RGWRados *_store, const std::string& oid) + : RGWAsyncRadosRequest(caller, cn), store(_store), oid(oid) {} + + RGWBucketInfo bucket_info; }; class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine { @@ -698,11 +697,14 @@ class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine { } int send_request() override { - req = new RGWAsyncGetBucketInstanceInfo(this, stack->create_completion_notifier(), store, oid, bucket_info); + req = new RGWAsyncGetBucketInstanceInfo(this, stack->create_completion_notifier(), store, oid); async_rados->queue(req); return 0; } int request_complete() override { + if (bucket_info) { + *bucket_info = std::move(req->bucket_info); + } return req->get_ret_status(); } };