*/
int ceph_conf_set(struct ceph_mount_info *cmount, const char *option, const char *value);
+/** Set mount timeout.
+ *
+ * @param cmount mount handle to set the configuration value on
+ * @param timeout mount timeout interval
+ *
+ * @returns 0 on success, negative error code otherwise.
+ */
+int ceph_set_mount_timeout(struct ceph_mount_info *cmount, uint32_t timeout);
+
/**
* Gets the configuration value as a string.
*
#include "common/version.h"
#include "mon/MonClient.h"
#include "include/str_list.h"
+#include "include/stringify.h"
#include "messages/MMonMap.h"
#include "msg/Messenger.h"
#include "include/ceph_assert.h"
return cmount->conf_get(option, buf, len);
}
+extern "C" int ceph_set_mount_timeout(struct ceph_mount_info *cmount, uint32_t timeout) {
+ if (cmount->is_mounted()) {
+ return -EINVAL;
+ }
+
+ auto timeout_str = stringify(timeout);
+ return ceph_conf_set(cmount, "client_mount_timeout", timeout_str.c_str());
+}
+
extern "C" int ceph_mds_command(struct ceph_mount_info *cmount,
const char *mds_spec,
const char **cmd,