Merge pull request #14390 from shashalu/drop-unused-param

rgw: drop unused param "bucket" from select_bucket_placement

Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2017-05-01 10:54:01 -04:00 committed by GitHub
commit 6ac2dbf89e
4 changed files with 15 additions and 16 deletions

View File

@ -2234,7 +2234,7 @@ public:
bci.info.bucket.name = bucket_name;
bci.info.bucket.bucket_id = bucket_instance;
bci.info.bucket.tenant = tenant_name;
ret = store->select_bucket_location_by_rule(bci.info.placement_rule, bci.info.bucket, &rule_info);
ret = store->select_bucket_location_by_rule(bci.info.placement_rule, &rule_info);
if (ret < 0) {
ldout(store->ctx(), 0) << "ERROR: select_bucket_placement() returned " << ret << dendl;
return ret;

View File

@ -2328,7 +2328,7 @@ void RGWCreateBucket::execute()
bucket.name = s->bucket_name;
op_ret = store->select_bucket_placement(*(s->user), zonegroup_id,
placement_rule,
bucket, &selected_placement_rule, nullptr);
&selected_placement_rule, nullptr);
if (selected_placement_rule != s->bucket_info.placement_rule) {
op_ret = -EEXIST;
return;
@ -5543,7 +5543,6 @@ int RGWBulkUploadOp::handle_dir(const boost::string_ref path)
op_ret = store->select_bucket_placement(*(s->user),
store->get_zonegroup().get_id(),
placement_rule,
bucket,
&selected_placement_rule,
nullptr);
if (selected_placement_rule != binfo.placement_rule) {

View File

@ -5405,7 +5405,7 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket,
for (int i = 0; i < MAX_CREATE_RETRIES; i++) {
int ret = 0;
ret = select_bucket_placement(owner, zonegroup_id, placement_rule, bucket,
ret = select_bucket_placement(owner, zonegroup_id, placement_rule,
&selected_placement_rule_name, &rule_info);
if (ret < 0)
return ret;
@ -5500,7 +5500,7 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket,
}
int RGWRados::select_new_bucket_location(RGWUserInfo& user_info, const string& zonegroup_id, const string& request_rule,
rgw_bucket& bucket, string *pselected_rule_name, RGWZonePlacementInfo *rule_info)
string *pselected_rule_name, RGWZonePlacementInfo *rule_info)
{
/* first check that rule exists within the specific zonegroup */
@ -5541,16 +5541,16 @@ int RGWRados::select_new_bucket_location(RGWUserInfo& user_info, const string& z
if (pselected_rule_name)
*pselected_rule_name = rule;
return select_bucket_location_by_rule(rule, bucket, rule_info);
return select_bucket_location_by_rule(rule, rule_info);
}
int RGWRados::select_bucket_location_by_rule(const string& location_rule, rgw_bucket& bucket, RGWZonePlacementInfo *rule_info)
int RGWRados::select_bucket_location_by_rule(const string& location_rule, RGWZonePlacementInfo *rule_info)
{
if (location_rule.empty()) {
/* we can only reach here if we're trying to set a bucket location from a bucket
* created on a different zone, using a legacy / default pool configuration
*/
return select_legacy_bucket_placement(bucket, rule_info);
return select_legacy_bucket_placement(rule_info);
}
/*
@ -5581,21 +5581,21 @@ int RGWRados::select_bucket_location_by_rule(const string& location_rule, rgw_bu
}
int RGWRados::select_bucket_placement(RGWUserInfo& user_info, const string& zonegroup_id, const string& placement_rule,
rgw_bucket& bucket, string *pselected_rule_name, RGWZonePlacementInfo *rule_info)
string *pselected_rule_name, RGWZonePlacementInfo *rule_info)
{
if (!get_zone_params().placement_pools.empty()) {
return select_new_bucket_location(user_info, zonegroup_id, placement_rule,
bucket, pselected_rule_name, rule_info);
pselected_rule_name, rule_info);
}
if (pselected_rule_name) {
pselected_rule_name->clear();
}
return select_legacy_bucket_placement(bucket, rule_info);
return select_legacy_bucket_placement(rule_info);
}
int RGWRados::select_legacy_bucket_placement(rgw_bucket& bucket, RGWZonePlacementInfo *rule_info)
int RGWRados::select_legacy_bucket_placement(RGWZonePlacementInfo *rule_info)
{
bufferlist map_bl;
map<string, bufferlist> m;

View File

@ -2529,11 +2529,11 @@ public:
*/
int init_bucket_index(RGWBucketInfo& bucket_info, int num_shards);
int select_bucket_placement(RGWUserInfo& user_info, const string& zonegroup_id, const string& rule,
rgw_bucket& bucket, string *pselected_rule_name, RGWZonePlacementInfo *rule_info);
int select_legacy_bucket_placement(rgw_bucket& bucket, RGWZonePlacementInfo *rule_info);
string *pselected_rule_name, RGWZonePlacementInfo *rule_info);
int select_legacy_bucket_placement(RGWZonePlacementInfo *rule_info);
int select_new_bucket_location(RGWUserInfo& user_info, const string& zonegroup_id, const string& rule,
rgw_bucket& bucket, string *pselected_rule_name, RGWZonePlacementInfo *rule_info);
int select_bucket_location_by_rule(const string& location_rule, rgw_bucket& bucket, RGWZonePlacementInfo *rule_info);
string *pselected_rule_name, RGWZonePlacementInfo *rule_info);
int select_bucket_location_by_rule(const string& location_rule, RGWZonePlacementInfo *rule_info);
void create_bucket_id(string *bucket_id);
bool get_obj_data_pool(const string& placement_rule, const rgw_obj& obj, rgw_pool *pool);