From 777edc181d65678b9c9ca0dd0fd94465d3e5697b Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Mon, 20 Nov 2017 16:11:00 -0500 Subject: [PATCH] mon: Call get_json_str_map under wth_val To avoid temporary heap allocations. Signed-off-by: Adam C. Emerson --- src/mon/OSDMonitor.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 4ec000eac50f3..52c5afbb480ed 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -5457,9 +5457,11 @@ int OSDMonitor::parse_erasure_code_profile(const vector &erasure_code_pr map *erasure_code_profile_map, ostream *ss) { - int r = get_json_str_map(g_conf->get_val("osd_pool_default_erasure_code_profile"), - *ss, - erasure_code_profile_map); + int r = g_conf->with_val("osd_pool_default_erasure_code_profile", + get_json_str_map, + *ss, + erasure_code_profile_map, + true); if (r) return r; assert((*erasure_code_profile_map).count("plugin")); -- 2.39.5