diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-06-23 23:18:44 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-06-23 23:18:44 -0700 |
commit | 1e3161a84e820cedc22782fd1b7457b606ed685c (patch) | |
tree | 07842c847065e8ecb28315b4c7c50189f78fd902 | |
parent | 76228caf65627fff1845289687380706d24a14aa (diff) | |
download | ceph-1e3161a84e820cedc22782fd1b7457b606ed685c.tar.gz |
rgw: add a system request param to select op bucket instance
Added rgwx-bucket-instance request param that selects the actual bucket
instance to use for this request.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_common.h | 2 | ||||
-rw-r--r-- | src/rgw/rgw_op.cc | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index af70846f87c..847b3f07ec0 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -774,6 +774,8 @@ struct req_state { ACLOwner bucket_owner; ACLOwner owner; + string bucket_instance_id; + RGWBucketInfo bucket_info; map<string, bufferlist> bucket_attrs; bool bucket_exists; diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 202e438af5f..01a2cfeee22 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -318,6 +318,8 @@ static int rgw_build_policies(RGWRados *store, struct req_state *s, bool only_bu string obj_str; RGWUserInfo bucket_owner_info; + s->bucket_instance_id = s->info.args.get(RGW_SYS_PARAM_PREFIX "bucket-instance"); + s->bucket_acl = new RGWAccessControlPolicy(s->cct); if (s->copy_source) { /* check if copy source is within the current domain */ @@ -342,7 +344,11 @@ static int rgw_build_policies(RGWRados *store, struct req_state *s, bool only_bu if (s->bucket_name_str.size()) { s->bucket_exists = true; - ret = store->get_bucket_info(s->obj_ctx, s->bucket_name_str, s->bucket_info, NULL, &s->bucket_attrs); + if (s->bucket_instance_id.empty()) { + ret = store->get_bucket_info(s->obj_ctx, s->bucket_name_str, s->bucket_info, NULL, &s->bucket_attrs); + } else { + ret = store->get_bucket_instance_info(s->obj_ctx, s->bucket_instance_id, s->bucket_info, NULL, &s->bucket_attrs); + } if (ret < 0) { if (ret != -ENOENT) { ldout(s->cct, 0) << "NOTICE: couldn't get bucket from bucket_name (name=" << s->bucket_name_str << ")" << dendl; |