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;
}
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;
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();
}
}
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;
}