From 059653a03d4bfd39367a3dfcd9961fb2494dae62 Mon Sep 17 00:00:00 2001 From: trasz Date: Sat, 29 Nov 2014 15:41:55 +0000 Subject: MFC r273849: Add support for "timeo", "actimeo", "noac", and "proto" options to mount_nfs(8). They are implemented on Linux, OS X, and Solaris, and thus can be expected to appear in automounter maps. Sponsored by: The FreeBSD Foundation --- sys/fs/nfsclient/nfs_clvfsops.c | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) (limited to 'sys/fs') diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 4cbbb24..469fa1d 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -722,15 +722,15 @@ nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp, } static const char *nfs_opts[] = { "from", "nfs_args", - "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union", + "noac", "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union", "noclusterr", "noclusterw", "multilabel", "acls", "force", "update", "async", "noconn", "nolockd", "conn", "lockd", "intr", "rdirplus", "readdirsize", "soft", "hard", "mntudp", "tcp", "udp", "wsize", "rsize", - "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport", - "readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", - "principal", "nfsv4", "gssname", "allgssname", "dirpath", "minorversion", - "nametimeo", "negnametimeo", "nocto", "noncontigwr", "pnfs", - "wcommitsize", + "retrans", "actimeo", "acregmin", "acregmax", "acdirmin", "acdirmax", + "resvport", "readahead", "hostname", "timeo", "timeout", "addr", "fh", + "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", + "minorversion", "nametimeo", "negnametimeo", "nocto", "noncontigwr", + "pnfs", "wcommitsize", NULL }; /* @@ -815,6 +815,12 @@ nfs_mount(struct mount *mp) } /* Handle the new style options. */ + if (vfs_getopt(mp->mnt_optnew, "noac", NULL, NULL) == 0) { + args.acdirmin = args.acdirmax = + args.acregmin = args.acregmax = 0; + args.flags |= NFSMNT_ACDIRMIN | NFSMNT_ACDIRMAX | + NFSMNT_ACREGMIN | NFSMNT_ACREGMAX; + } if (vfs_getopt(mp->mnt_optnew, "noconn", NULL, NULL) == 0) args.flags |= NFSMNT_NOCONN; if (vfs_getopt(mp->mnt_optnew, "conn", NULL, NULL) == 0) @@ -930,6 +936,18 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_RETRANS; } + if (vfs_getopt(mp->mnt_optnew, "actimeo", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &args.acregmin); + if (ret != 1 || args.acregmin < 0) { + vfs_mount_error(mp, "illegal actimeo: %s", + opt); + error = EINVAL; + goto out; + } + args.acdirmin = args.acdirmax = args.acregmax = args.acregmin; + args.flags |= NFSMNT_ACDIRMIN | NFSMNT_ACDIRMAX | + NFSMNT_ACREGMIN | NFSMNT_ACREGMAX; + } if (vfs_getopt(mp->mnt_optnew, "acregmin", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &args.acregmin); if (ret != 1 || args.acregmin < 0) { @@ -979,6 +997,16 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_WCOMMITSIZE; } + if (vfs_getopt(mp->mnt_optnew, "timeo", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &args.timeo); + if (ret != 1 || args.timeo <= 0) { + vfs_mount_error(mp, "illegal timeo: %s", + opt); + error = EINVAL; + goto out; + } + args.flags |= NFSMNT_TIMEO; + } if (vfs_getopt(mp->mnt_optnew, "timeout", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &args.timeo); if (ret != 1 || args.timeo <= 0) { -- cgit v1.1