summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-07-03 12:07:28 -0700
committerSage Weil <sage@inktank.com>2012-07-06 16:45:24 -0700
commitb554d112c107efe78ec64f85b5fe588f1e7137ce (patch)
treefac14f18b13ae1f29cd10ca396182fa1fef934a4
parent01da287b8fdc07262be252f1a7c115734d3cc328 (diff)
downloadceph-b554d112c107efe78ec64f85b5fe588f1e7137ce.tar.gz
config: add unlocked version of get_my_sections; use it internally
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/common/config.cc8
-rw-r--r--src/common/config.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/common/config.cc b/src/common/config.cc
index 840ebd2f91c..94390c1924b 100644
--- a/src/common/config.cc
+++ b/src/common/config.cc
@@ -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());
diff --git a/src/common/config.h b/src/common/config.h
index 212b4dbd621..c98b8ba88ff 100644
--- a/src/common/config.h
+++ b/src/common/config.h
@@ -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;