mount: accept monitor host (mon_host) mount option

With new mount device syntax monitor host(s) can be passed
during mount as option parameter. This option is not mandatory
as it can be fetched from the cluster configuration file if
available.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
Venky Shankar 2021-05-03 06:30:34 -04:00
parent 7dee504a41
commit f47b7bcbf8

View File

@ -327,6 +327,15 @@ static int parse_options(const char *data, struct ceph_mount_info *cmi)
/* Only legacy ms_mode needs v1 addrs */
v2_addrs = strcmp(value, "legacy");
skip = false;
} else if (strcmp(data, "mon_host") == 0) {
/* monitor address to use for mounting */
if (!value || !*value) {
fprintf(stderr, "mount option mon_host requires a value.\n");
return -EINVAL;
}
cmi->cmi_mons = strdup(value);
if (!cmi->cmi_mons)
return -ENOMEM;
} else {
/* unrecognized mount options, passing to kernel */
skip = false;