void init_default_bucket_layout(CephContext *cct, rgw::BucketLayout& layout,
const RGWZone& zone,
- std::optional<uint32_t> shards,
std::optional<rgw::BucketIndexType> type) {
layout.current_index.gen = 0;
layout.current_index.layout.normal.hash_type = rgw::BucketHashType::Mod;
layout.current_index.layout.type =
type.value_or(rgw::BucketIndexType::Normal);
- if (shards) {
- layout.current_index.layout.normal.num_shards = *shards;
- } else if (cct->_conf->rgw_override_bucket_index_max_shards > 0) {
+ if (cct->_conf->rgw_override_bucket_index_max_shards > 0) {
layout.current_index.layout.normal.num_shards =
cct->_conf->rgw_override_bucket_index_max_shards;
} else {
bci.info.layout = rgw::BucketLayout{};
init_default_bucket_layout(cct, bci.info.layout,
bihandler->svc.zone->get_zone(),
- std::nullopt, std::nullopt);
+ std::nullopt);
} else {
bci.info.layout = old_bci->info.layout;
}
void init_default_bucket_layout(CephContext *cct, rgw::BucketLayout& layout,
const RGWZone& zone,
- std::optional<uint32_t> shards,
std::optional<rgw::BucketIndexType> type);
struct RGWBucketCompleteInfo {
obj_version *pobjv,
obj_version *pep_objv,
real_time creation_time,
- rgw_bucket *pmaster_bucket,
- uint32_t *pmaster_num_shards,
+ const rgw_bucket* pmaster_bucket,
optional_yield y,
const DoutPrefixProvider *dpp,
bool exclusive)
info.swift_versioning = (!swift_ver_location.empty());
init_default_bucket_layout(cct, info.layout, svc.zone->get_zone(),
- pmaster_num_shards ?
- std::optional{*pmaster_num_shards} :
- std::nullopt,
rule_info.index_type);
info.requester_pays = false;
obj_version *pobjv,
obj_version *pep_objv,
ceph::real_time creation_time,
- rgw_bucket *master_bucket,
- uint32_t *master_num_shards,
+ const rgw_bucket *master_bucket,
optional_yield y,
const DoutPrefixProvider *dpp,
bool exclusive = true);
bufferlist in_data;
RGWBucketInfo master_info;
rgw_bucket* pmaster_bucket;
- uint32_t* pmaster_num_shards;
real_time creation_time;
std::unique_ptr<Bucket> bucket;
obj_version objv,* pobjv = NULL;
ldpp_dout(dpp, 20) << "got creation time: << " << std::put_time(std::localtime(&ctime), "%F %T") << dendl;
pmaster_bucket= &master_info.bucket;
creation_time = master_info.creation_time;
- pmaster_num_shards = &master_info.layout.current_index.layout.normal.num_shards;
pobjv = &objv;
if (master_info.obj_lock_enabled()) {
info.flags = BUCKET_VERSIONED | BUCKET_OBJ_LOCK_ENABLED;
}
} else {
pmaster_bucket = NULL;
- pmaster_num_shards = NULL;
if (obj_lock_enabled)
info.flags = BUCKET_VERSIONED | BUCKET_OBJ_LOCK_ENABLED;
}
ret = store->getRados()->create_bucket(this->get_info(), bucket->get_key(),
zid, placement_rule, swift_ver_location, pquota_info,
attrs, info, pobjv, &ep_objv, creation_time,
- pmaster_bucket, pmaster_num_shards, y, dpp,
- exclusive);
+ pmaster_bucket, y, dpp, exclusive);
if (ret == -EEXIST) {
*existed = true;
/* bucket already existed, might have raced with another bucket creation,