From: oliveiradan Date: Fri, 12 May 2017 20:27:25 +0000 (-0600) Subject: Last changes for PR #10736 X-Git-Tag: v12.1.0~10^2~68^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f0bed0a3b00543303489bb5598d267cdfd94e71b;p=ceph.git Last changes for PR #10736 Signed-off-by: Daniel Oliveira --- diff --git a/src/common/config.cc b/src/common/config.cc index 2a91e0d947d..5703e962392 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -1346,29 +1346,28 @@ void md_config_t::diff( map > *diff, set *unknown) { - diff_helper(other, diff, unknown, ""); + diff_helper(other, diff, unknown); } void md_config_t::diff( const md_config_t *other, map > *diff, - set *unknown, const string& ceph_setting = string("")) + set *unknown, const string& setting) { - diff_helper(other, diff, unknown, ceph_setting); + diff_helper(other, diff, unknown, setting); } void md_config_t::diff_helper( const md_config_t *other, map > *diff, - set *unknown, const string& ceph_setting=string("")) + set *unknown, const string& setting) { Mutex::Locker l(lock); - bool ceph_param_search = !ceph_setting.empty(); char local_buf[4096]; char other_buf[4096]; - for (auto& opt: *config_options) { - if (ceph_param_search) { - if (ceph_setting != opt.name) { + for (auto& opt : *config_options) { + if (!setting.empty()) { + if (setting != opt.name) { continue; } } @@ -1378,7 +1377,7 @@ void md_config_t::diff_helper( char *other_val = other_buf; int err = other->get_val(opt.name, &other_val, sizeof(other_buf)); if (err < 0) { - if (ceph_param_search) { + if (!setting.empty()) { continue; } if (err == -ENOENT) { @@ -1395,7 +1394,7 @@ void md_config_t::diff_helper( if (strcmp(local_val, other_val)) diff->insert(make_pair(opt.name, make_pair(local_val, other_val))); else { - if (ceph_param_search) { + if (!setting.empty()) { diff->insert(make_pair(opt.name, make_pair(local_val, other_val))); break; } diff --git a/src/common/config.h b/src/common/config.h index 2590c47c80c..caabc46b81d 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -243,7 +243,7 @@ public: /// values for a specific setting. void diff(const md_config_t *other, map> *diff, set *unknown, - const string& ceph_setting); + const string& setting); /// print/log warnings/errors from parsing the config void complain_about_parse_errors(CephContext *cct); @@ -277,9 +277,9 @@ private: bool expand_meta(std::string &val, std::ostream *oss) const; - void diff_helper(const md_config_t *other, - map> *diff, - set *unknown, const string &ceph_setting); + void diff_helper(const md_config_t* other, + map>* diff, + set* unknown, const string& setting = string{}); public: // for global_init bool early_expand_meta(std::string &val,