<< std::endl;
ceph_abort();
}
- schema.emplace(std::piecewise_construct,
- std::forward_as_tuple(i.name),
- std::forward_as_tuple(i));
+ schema.emplace(i.name, i);
}
// Define the debug_* options as well.
// members if present.
legacy_values = {
#define OPTION(name, type) \
- {std::string(STRINGIFY(name)), &ConfigValues::name},
+ {STRINGIFY(name), &ConfigValues::name},
#define SAFE_OPTION(name, type) OPTION(name, type)
#include "common/legacy_config_opts.h"
#undef OPTION
/*
* Mapping from legacy config option names to class members
*/
- std::map<std::string, member_ptr_t> legacy_values;
+ std::map<std::string_view, member_ptr_t> legacy_values;
/**
* The configuration schema, in the form of Option objects describing
* possible settings.
*/
- std::map<std::string, const Option&> schema;
+ std::map<std::string_view, const Option&> schema;
/// values from mon that we failed to set
std::map<std::string,std::string> ignored_mon_values;
const uint32_t MAX_KEYS = 64;
-typedef std::map<std::string, std::pair<std::string, config_source_t>> Parent;
+typedef std::map<std::string_view, std::pair<std::string, config_source_t>> Parent;
-static std::set<std::string> EXCLUDE_OPTIONS {
+static std::set<std::string_view> EXCLUDE_OPTIONS {
"rbd_auto_exclusive_lock_until_manual_request",
"rbd_default_format",
"rbd_default_map_options",
"rbd_validate_pool",
"rbd_mirror_pool_replayers_refresh_interval"
};
-static std::set<std::string> EXCLUDE_IMAGE_OPTIONS {
+static std::set<std::string_view> EXCLUDE_IMAGE_OPTIONS {
"rbd_default_clone_format",
"rbd_default_data_pool",
"rbd_default_features",
CephContext *cct = (CephContext *)io_ctx.cct();
for (auto &it : *this) {
- int r = cct->_conf.get_val(it.first.c_str(), &it.second.first);
+ int r = cct->_conf.get_val(std::string(it.first), &it.second.first);
ceph_assert(r == 0);
it.second.second = RBD_CONFIG_SOURCE_CONFIG;
}
return r;
}
- for (auto &it : opts) {
- options->push_back({it.first, it.second.first, it.second.second});
+ for (auto& [k,v] : opts) {
+ options->push_back({std::string{k}, v.first, v.second});
}
return 0;
}
}
- for (auto &it : opts) {
- options->push_back({it.first, it.second.first, it.second.second});
+ for (auto& [k,v] : opts) {
+ options->push_back({std::string{k}, v.first, v.second});
}
return 0;
return;
}
- for (auto& pair : opts) {
- if (pair.second.second == RBD_CONFIG_SOURCE_POOL) {
- r = config->set_val(pair.first, pair.second.first);
+ for (auto& [k,v] : opts) {
+ if (v.second == RBD_CONFIG_SOURCE_POOL) {
+ r = config->set_val(std::string(k), v.first);
if (r < 0) {
- lderr(cct) << "failed to override pool config " << pair.first << "="
- << pair.second.first << ": " << cpp_strerror(r) << dendl;
+ lderr(cct) << "failed to override pool config " << k << "="
+ << v.first << ": " << cpp_strerror(r) << dendl;
}
}
}