aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount_nfs
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1998-05-19 07:18:28 +0000
committerPeter Wemm <peter@FreeBSD.org>1998-05-19 07:18:28 +0000
commitc92e3fa53306bcaf479bfac3feafc463eb220ce8 (patch)
treedfd31bf24b43080229f0abb4dc146156d37d1432 /sbin/mount_nfs
parent4183b6b62220c657b2935fc1fe62757684314fe9 (diff)
downloadsrc-c92e3fa53306bcaf479bfac3feafc463eb220ce8.tar.gz
src-c92e3fa53306bcaf479bfac3feafc463eb220ce8.zip
Support changing the attribute cache limits per-mount. We don't have
many option letters left, I used long names only (like the previous port= option)
Notes
Notes: svn path=/head/; revision=36178
Diffstat (limited to 'sbin/mount_nfs')
-rw-r--r--sbin/mount_nfs/mount_nfs.813
-rw-r--r--sbin/mount_nfs/mount_nfs.c27
2 files changed, 38 insertions, 2 deletions
diff --git a/sbin/mount_nfs/mount_nfs.8 b/sbin/mount_nfs/mount_nfs.8
index ac06971ac651..35199af0c126 100644
--- a/sbin/mount_nfs/mount_nfs.8
+++ b/sbin/mount_nfs/mount_nfs.8
@@ -31,7 +31,7 @@
.\"
.\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95
.\"
-.\" $Id: mount_nfs.8,v 1.10 1997/10/19 16:39:59 joerg Exp $
+.\" $Id: mount_nfs.8,v 1.11 1998/05/01 13:52:17 peter Exp $
.\""
.Dd March 29, 1995
.Dt MOUNT_NFS 8
@@ -187,6 +187,17 @@ The following NFS specific option is also available:
.It port=<port_number>
Use specified port number for NFS requests.
The default is to query the portmapper for the NFS port.
+.It acregmin=<seconds>
+.It acregmax=<seconds>
+.It acdirmin=<seconds>
+.It acdirmax=<seconds>
+When attributes of files are cached, a timeout caclulated to determine
+whether a given cache entry has expired. These four values determine the
+upper and lower bounds of the timeouts for ``directory'' attributes and
+``regular'' (ie: everything else). The default values are 3 -> 60 seconds
+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.
.El
.Pp
.Bl -tag -width "dumbtimerXX"
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 510db4ab7e6c..f28e1992a22b 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -45,7 +45,7 @@ static char copyright[] =
static char sccsid[] = "@(#)mount_nfs.c 8.11 (Berkeley) 5/4/95";
*/
static const char rcsid[] =
- "$Id: mount_nfs.c,v 1.26 1997/12/26 23:28:12 imp Exp $";
+ "$Id: mount_nfs.c,v 1.27 1998/02/01 21:53:19 bde Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -104,6 +104,10 @@ static const char rcsid[] =
#define ALTF_TCP 0x1000
#define ALTF_PORT 0x2000
#define ALTF_NFSV2 0x4000
+#define ALTF_ACREGMIN 0x8000
+#define ALTF_ACREGMAX 0x10000
+#define ALTF_ACDIRMIN 0x20000
+#define ALTF_ACDIRMAX 0x40000
struct mntopt mopts[] = {
MOPT_STDOPTS,
@@ -129,6 +133,10 @@ struct mntopt mopts[] = {
{ "tcp", 0, ALTF_TCP, 1 },
{ "port=", 0, ALTF_PORT, 1 },
{ "nfsv2", 0, ALTF_NFSV2, 1 },
+ { "acregmin=", 0, ALTF_ACREGMIN, 1 },
+ { "acregmax=", 0, ALTF_ACREGMAX, 1 },
+ { "acdirmin=", 0, ALTF_ACDIRMIN, 1 },
+ { "acdirmax=", 0, ALTF_ACDIRMAX, 1 },
{ NULL }
};
@@ -151,6 +159,11 @@ struct nfs_args nfsdefargs = {
NQ_DEFLEASE,
NQ_DEADTHRESH,
(char *)0,
+ /* args version 4 */
+ NFS_MINATTRTIMO,
+ NFS_MAXATTRTIMO,
+ NFS_MINDIRATTRTIMO,
+ NFS_MAXDIRATTRTIMO,
};
struct nfhret {
@@ -374,6 +387,18 @@ main(argc, argv)
mountmode = V2;
if(altflags & ALTF_NFSV3)
mountmode = V3;
+ if(altflags & ALTF_ACREGMIN)
+ nfsargsp->acregmin = atoi(strstr(optarg,
+ "acregmin=") + 9);
+ if(altflags & ALTF_ACREGMAX)
+ nfsargsp->acregmax = atoi(strstr(optarg,
+ "acregmax=") + 9);
+ if(altflags & ALTF_ACDIRMIN)
+ nfsargsp->acdirmin = atoi(strstr(optarg,
+ "acdirmin=") + 9);
+ if(altflags & ALTF_ACDIRMAX)
+ nfsargsp->acdirmax = atoi(strstr(optarg,
+ "acdirmax=") + 9);
break;
case 'P':
/* obsolete for NFSMNT_RESVPORT, now default */