RGWZone *sz;
- if (!static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(source_zone, &sz)) {
+ if (!(sz = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(source_zone))) {
push_ss(ss, status, tab) << string("zone not found");
flush_ss(ss, status);
return;
string source_str = "source: ";
string s = source_str + source_id.id;
RGWZone *sz;
- if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(source_id, &sz)) {
+ if ((sz = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(source_id))) {
s += string(" (") + sz->name + ")";
}
data_status.push_back(s);
rgw_zone_id result;
RGWZone *zone;
- if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(s, &zone)) {
+ if ((zone = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(s))) {
return rgw_zone_id(s);
}
if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone_id_by_name(s, &result)) {
auto zone_id = *(static_cast<const rgw_zone_id *>(pval));
string zone_name;
RGWZone *zone;
- if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(zone_id, &zone)) {
+ if ((zone = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(zone_id))) {
zone_name = zone->name;
} else {
cerr << "WARNING: cannot find zone name for id=" << zone_id << std::endl;
{
RGWZone *zone_def;
- if (!store->svc()->zone->find_zone(source_zone, &zone_def)) {
+ if (!(zone_def = store->svc()->zone->find_zone(source_zone))) {
ldpp_dout(this, 0) << "ERROR: failed to find zone config info for zone=" << source_zone << dendl;
return -EIO;
}
const RGWZoneParams& zone_params = store->svc()->zone->get_zone_params();
- if (sync_module == nullptr) {
+ if (sync_module == nullptr) {
sync_module = store->get_sync_module();
}
for (auto& id : zone_ids) {
RGWZone *zone;
- if (static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(id, &zone)) {
+ if ((zone = static_cast<rgw::sal::RadosStore*>(store)->svc()->zone->find_zone(id))) {
names.emplace_back(zone->name);
}
}
return get_zone_params().get_name();
}
-bool RGWSI_Zone::find_zone(const rgw_zone_id& id, RGWZone **zone)
+RGWZone* RGWSI_Zone::find_zone(const rgw_zone_id& id)
{
auto iter = zone_by_id.find(id);
if (iter == zone_by_id.end()) {
- return false;
+ return nullptr;
}
- *zone = &(iter->second);
- return true;
+ return &(iter->second);
}
RGWRESTConn *RGWSI_Zone::get_zone_conn(const rgw_zone_id& zone_id) {
return zone_data_notify_to_map;
}
- bool find_zone(const rgw_zone_id& id, RGWZone **zone);
+ RGWZone* find_zone(const rgw_zone_id& id);
RGWRESTConn *get_zone_conn(const rgw_zone_id& zone_id);
RGWRESTConn *get_zone_conn_by_name(const std::string& name);