summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-11-29 15:41:55 +0000
committertrasz <trasz@FreeBSD.org>2014-11-29 15:41:55 +0000
commit059653a03d4bfd39367a3dfcd9961fb2494dae62 (patch)
tree5a9eb5318f0fba3ce8a9c1999db4158c29a9616b /sbin
parent59965706b27f25134effa15ea485c0b802cf62fd (diff)
downloadFreeBSD-src-059653a03d4bfd39367a3dfcd9961fb2494dae62.zip
FreeBSD-src-059653a03d4bfd39367a3dfcd9961fb2494dae62.tar.gz
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
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mount_nfs/mount_nfs.818
-rw-r--r--sbin/mount_nfs/mount_nfs.c29
2 files changed, 46 insertions, 1 deletions
diff --git a/sbin/mount_nfs/mount_nfs.8 b/sbin/mount_nfs/mount_nfs.8
index 124ba7d..55080e9 100644
--- a/sbin/mount_nfs/mount_nfs.8
+++ b/sbin/mount_nfs/mount_nfs.8
@@ -28,7 +28,7 @@
.\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95
.\" $FreeBSD$
.\"
-.Dd August 5, 2014
+.Dd October 30, 2014
.Dt MOUNT_NFS 8
.Os
.Sh NAME
@@ -118,6 +118,8 @@ for regular files, and 30 -> 60 seconds for directories.
The algorithm to calculate the timeout is based on the age of the file.
The older the file,
the longer the cache is considered valid, subject to the limits above.
+.It Cm actimeo Ns = Ns Aq Ar seconds
+Set four cache timeouts above to specified value.
.It Cm allgssname
This option can be used along with
.Fl o Cm gssname
@@ -211,6 +213,8 @@ NFS Version 4 protocol.
This option is only meaningful when used with the
.Cm minorversion
option.
+.It Cm noac
+Disable attribute caching.
.It Cm noconn
For UDP mount points, do not do a
.Xr connect 2 .
@@ -282,6 +286,15 @@ use a reserved socket port number (see below).
.It Cm port Ns = Ns Aq Ar port_number
Use specified port number for NFS requests.
The default is to query the portmapper for the NFS port.
+.It Cm proto Ns = Ns Aq Ar protocol
+Specify transport protocol version to use.
+Currently, they are:
+.Bd -literal
+udp - Use UDP over IPv4
+tcp - Use TCP over IPv4
+udp6 - Use UDP over IPv6
+tcp6 - Use TCP over IPv6
+.Ed
.It Cm rdirplus
Used with NFSV3 to specify that the \fBReaddirPlus\fR RPC should
be used.
@@ -369,6 +382,9 @@ value if there is a low retransmit rate but long response delay observed.
option should be specified when using this option to manually
tune the timeout
interval.)
+.It Cm timeo Ns = Ns Aq Ar value
+Alias for
+.Cm timeout .
.It Cm udp
Use UDP transport.
.It Cm vers Ns = Ns Aq Ar vers_number
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 383f475..dc38720 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -284,6 +284,35 @@ main(int argc, char *argv[])
err(1, "asprintf");
} else if (strcmp(opt, "principal") == 0) {
got_principal = 1;
+ } else if (strcmp(opt, "proto") == 0) {
+ pass_flag_to_nmount=0;
+ if (strcmp(val, "tcp") == 0) {
+ nfsproto = IPPROTO_TCP;
+ opflags |= OF_NOINET6;
+ build_iovec(&iov, &iovlen,
+ "tcp", NULL, 0);
+ } else if (strcmp(val, "udp") == 0) {
+ mnttcp_ok = 0;
+ nfsproto = IPPROTO_UDP;
+ opflags |= OF_NOINET6;
+ build_iovec(&iov, &iovlen,
+ "udp", NULL, 0);
+ } else if (strcmp(val, "tcp6") == 0) {
+ nfsproto = IPPROTO_TCP;
+ opflags |= OF_NOINET4;
+ build_iovec(&iov, &iovlen,
+ "tcp", NULL, 0);
+ } else if (strcmp(val, "udp6") == 0) {
+ mnttcp_ok = 0;
+ nfsproto = IPPROTO_UDP;
+ opflags |= OF_NOINET4;
+ build_iovec(&iov, &iovlen,
+ "udp", NULL, 0);
+ } else {
+ errx(1,
+ "illegal proto value -- %s",
+ val);
+ }
} else if (strcmp(opt, "sec") == 0) {
/*
* Don't add this option to
OpenPOWER on IntegriCloud