]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/config.cc
import ceph 16.2.7
[ceph.git] / ceph / src / common / config.cc
index 4916858676675c3122323e7e3091f034999bcfe9..e15c99e7d09e67fed19cfc1e3ed9b3f6b640473b 100644 (file)
@@ -1029,6 +1029,16 @@ void md_config_t::get_config_bl(
   }
 }
 
+std::optional<std::string> md_config_t::get_val_default(std::string_view key)
+{
+  std::string val;
+  const Option *opt = find_option(key);
+  if (opt && (conf_stringify(_get_val_default(*opt), &val) == 0)) {
+    return std::make_optional(std::move(val));
+  }
+  return std::nullopt;
+}
+
 int md_config_t::get_val(const ConfigValues& values,
                         const std::string_view key, char **buf, int len) const
 {