From: Casey Bodley Date: Thu, 30 Jun 2016 19:50:00 +0000 (-0400) Subject: rgw: add tenant id to GetBucketInstanceInfo X-Git-Tag: v10.2.3~13^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f68337aaa535ea182258eb4934af739fb703f556;p=ceph.git rgw: add tenant id to GetBucketInstanceInfo use the rgw_bucket overload of get_bucket_instance_info() so it can supply the tenant id Signed-off-by: Casey Bodley (cherry picked from commit 3cf715c6828d7d9732bf6a6fd9b46bbd8c08de5f) --- diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index acc4653411e7..19fb94944d6d 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -461,12 +461,11 @@ bool RGWOmapAppend::finish() { int RGWAsyncGetBucketInstanceInfo::_send_request() { - string id = bucket_name + ":" + bucket_id; RGWObjectCtx obj_ctx(store); - - int r = store->get_bucket_instance_info(obj_ctx, id, *bucket_info, NULL, NULL); + int r = store->get_bucket_instance_info(obj_ctx, bucket, *bucket_info, NULL, NULL); if (r < 0) { - ldout(store->ctx(), 0) << "ERROR: failed to get bucket instance info for bucket id=" << id << dendl; + ldout(store->ctx(), 0) << "ERROR: failed to get bucket instance info for " + << bucket << dendl; return r; } diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index fe337bce840a..24a284d63d52 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -660,25 +660,23 @@ public: class RGWAsyncGetBucketInstanceInfo : public RGWAsyncRadosRequest { RGWRados *store; - string bucket_name; - string bucket_id; + rgw_bucket bucket; RGWBucketInfo *bucket_info; protected: int _send_request(); public: - RGWAsyncGetBucketInstanceInfo(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWRados *_store, - const string& _bucket_name, const string& _bucket_id, - RGWBucketInfo *_bucket_info) : RGWAsyncRadosRequest(caller, cn), store(_store), - bucket_name(_bucket_name), bucket_id(_bucket_id), - bucket_info(_bucket_info) {} + RGWAsyncGetBucketInstanceInfo(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, + RGWRados *_store, const rgw_bucket& bucket, + RGWBucketInfo *_bucket_info) + : RGWAsyncRadosRequest(caller, cn), store(_store), + bucket(bucket), bucket_info(_bucket_info) {} }; class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine { RGWAsyncRadosProcessor *async_rados; RGWRados *store; - string bucket_name; - string bucket_id; + rgw_bucket bucket; RGWBucketInfo *bucket_info; RGWAsyncGetBucketInstanceInfo *req; @@ -687,8 +685,7 @@ public: RGWGetBucketInstanceInfoCR(RGWAsyncRadosProcessor *_async_rados, RGWRados *_store, const rgw_bucket& bucket, RGWBucketInfo *_bucket_info) : RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados), store(_store), - bucket_name(bucket.name), bucket_id(bucket.bucket_id), - bucket_info(_bucket_info), req(NULL) {} + bucket(bucket), bucket_info(_bucket_info), req(NULL) {} ~RGWGetBucketInstanceInfoCR() { request_cleanup(); } @@ -700,7 +697,7 @@ public: } int send_request() { - req = new RGWAsyncGetBucketInstanceInfo(this, stack->create_completion_notifier(), store, bucket_name, bucket_id, bucket_info); + req = new RGWAsyncGetBucketInstanceInfo(this, stack->create_completion_notifier(), store, bucket, bucket_info); async_rados->queue(req); return 0; }