]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
config: add unlocked version of get_my_sections; use it internally
authorSage Weil <sage@inktank.com>
Tue, 3 Jul 2012 19:07:28 +0000 (12:07 -0700)
committerSage Weil <sage@inktank.com>
Fri, 6 Jul 2012 23:45:24 +0000 (16:45 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/common/config.cc
src/common/config.h

index 840ebd2f91c92af1d025ddd797feb36ad64af745..94390c1924b7166a074bf42b25ad17cc2437272a 100644 (file)
@@ -216,7 +216,7 @@ int md_config_t::parse_config_files_impl(const std::list<std::string> &conf_file
     return -EINVAL;
 
   std::vector <std::string> my_sections;
-  get_my_sections(my_sections);
+  _get_my_sections(my_sections);
   for (int i = 0; i < NUM_CONFIG_OPTIONS; i++) {
     config_option *opt = &config_optionsp[i];
     std::string val;
@@ -737,6 +737,12 @@ int md_config_t::_get_val(const char *key, char **buf, int len) const
 void md_config_t::get_my_sections(std::vector <std::string> &sections) const
 {
   Mutex::Locker l(lock);
+  _get_my_sections(sections);
+}
+
+void md_config_t::_get_my_sections(std::vector <std::string> &sections) const
+{
+  assert(lock.is_locked());
   sections.push_back(name.to_str());
 
   sections.push_back(name.get_type_name());
index 212b4dbd62111be103835ac53f04d87789d05bae..c98b8ba88ff1427d76537f3d3914a8fa0f0c52cb 100644 (file)
@@ -145,6 +145,8 @@ public:
 private:
   void _show_config(std::ostream& out);
 
+  void _get_my_sections(std::vector <std::string> &sections) const;
+
   int _get_val_from_conf_file(const std::vector <std::string> &sections,
                              const char *key, std::string &out, bool emeta) const;