]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/config: s/_get_val/_get_val_generic/
authorKefu Chai <kchai@redhat.com>
Mon, 9 Oct 2017 01:45:57 +0000 (09:45 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 9 Oct 2017 02:38:08 +0000 (10:38 +0800)
avoid distinguish two methods with their return types and non-templated
versus templated. also, this follows the convention of md_config_t.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/config.cc
src/common/config.h

index 4883418c03ab512fee4e5646947c60fe3f12f418..2b54a3bf95bfb76aecec908d2dc975d199c2ad85 100644 (file)
@@ -874,10 +874,10 @@ int md_config_t::get_val(const std::string &key, char **buf, int len) const
 Option::value_t md_config_t::get_val_generic(const std::string &key) const
 {
   Mutex::Locker l(lock);
-  return _get_val(key);
+  return _get_val_generic(key);
 }
 
-Option::value_t md_config_t::_get_val(const std::string &key) const
+Option::value_t md_config_t::_get_val_generic(const std::string &key) const
 {
   assert(lock.is_locked());
 
@@ -902,7 +902,7 @@ int md_config_t::_get_val(const std::string &key, std::string *value) const {
   assert(lock.is_locked());
 
   std::string normalized_key(ConfFile::normalize_key_name(key));
-  Option::value_t config_value = _get_val(normalized_key.c_str());
+  Option::value_t config_value = _get_val_generic(normalized_key.c_str());
   if (!boost::get<boost::blank>(&config_value)) {
     ostringstream oss;
     if (bool *flag = boost::get<bool>(&config_value)) {
index 768521f9489eaa2ed8ca40bfc383f9e7d8158e2d..8c4d566a50e93dd8cf448ee112fce1d0f2dd25fd 100644 (file)
@@ -200,7 +200,7 @@ private:
   void validate_default_settings();
 
   int _get_val(const std::string &key, std::string *value) const;
-  Option::value_t _get_val(const std::string &key) const;
+  Option::value_t _get_val_generic(const std::string &key) const;
   void _show_config(std::ostream *out, Formatter *f);
 
   void _get_my_sections(std::vector <std::string> &sections) const;
@@ -340,7 +340,7 @@ template<typename T> T md_config_t::get_val(const std::string &key) const {
 }
 
 template<typename T> T md_config_t::_get_val(const std::string &key) const {
-  Option::value_t generic_val = this->_get_val(key);
+  Option::value_t generic_val = this->_get_val_generic(key);
   get_typed_value_visitor<T> gtv;
   return boost::apply_visitor(gtv, generic_val);
 }