mon: Call get_json_str_map under wth_val

To avoid temporary heap allocations.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
Adam C. Emerson 2017-11-20 16:11:00 -05:00
parent 8dafb23516
commit 777edc181d

View File

@ -5457,9 +5457,11 @@ int OSDMonitor::parse_erasure_code_profile(const vector<string> &erasure_code_pr
map<string,string> *erasure_code_profile_map,
ostream *ss)
{
int r = get_json_str_map(g_conf->get_val<string>("osd_pool_default_erasure_code_profile"),
*ss,
erasure_code_profile_map);
int r = g_conf->with_val<string>("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"));