summaryrefslogtreecommitdiff
path: root/sbin/mount_nfs
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-10-07 18:35:58 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-10-07 18:35:58 +0000
commitb9907fbad4873706ef2eadf582faf8c1a2dbd201 (patch)
treed860a20e893f7e65dc04212009d60ffdbaa87a36 /sbin/mount_nfs
parent29abf1981089118cea78a23844ba31e692f331d6 (diff)
add support for modifying attribute cache parameters
inspired by PR2567, the included diff was wrong tho and not used here manpage from millert@ ok millert@ on code and jmc@ on manpage
Diffstat (limited to 'sbin/mount_nfs')
-rw-r--r--sbin/mount_nfs/mount_nfs.826
-rw-r--r--sbin/mount_nfs/mount_nfs.c30
2 files changed, 52 insertions, 4 deletions
diff --git a/sbin/mount_nfs/mount_nfs.8 b/sbin/mount_nfs/mount_nfs.8
index 0f3d6d80294..5a2d4c89277 100644
--- a/sbin/mount_nfs/mount_nfs.8
+++ b/sbin/mount_nfs/mount_nfs.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mount_nfs.8,v 1.31 2003/06/02 20:06:15 millert Exp $
+.\" $OpenBSD: mount_nfs.8,v 1.32 2003/10/07 18:35:57 henning Exp $
.\" $NetBSD: mount_nfs.8,v 1.3 1996/02/18 11:59:10 fvdl Exp $
.\"
.\" Copyright (c) 1992, 1993, 1994, 1995
@@ -151,11 +151,31 @@ See the
man page for possible options and their meanings.
The following NFS specific options are also available:
.Bl -tag -width indent
+.It acregmax=num
+Cache file attributes for no more than
+.Ar num
+seconds.
+The default is 60 seconds.
+.It acregmin=num
+Cache file attributes for at least
+.Ar num
+seconds.
+The default is 5 seconds.
+.It acdirmax=num
+Cache directory attributes for no more than
+.Ar num
+seconds.
+The default is 60 seconds.
+.It acdirmin=num
+Cache directory attributes for at least
+.Ar num
+seconds.
+The default is 5 seconds.
+.It noac
+Disable attribute caching for both files and directories.
.It port=portnumber
Use specified port number for NFS requests.
The default is to query the portmapper for the NFS port.
-.It noac
-Turn off attribute caching for both directories and files.
.El
.It Fl r Ar readsize
Set the read data size to the specified value.
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 01884e8d28c..416d8fa3bfc 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount_nfs.c,v 1.35 2003/07/29 18:38:36 deraadt Exp $ */
+/* $OpenBSD: mount_nfs.c,v 1.36 2003/10/07 18:35:57 henning Exp $ */
/* $NetBSD: mount_nfs.c,v 1.12.4.1 1996/05/25 22:48:05 fvdl Exp $ */
/*
@@ -97,6 +97,10 @@ static char rcsid[] = "$NetBSD: mount_nfs.c,v 1.12.4.1 1996/05/25 22:48:05 fvdl
#define ALTF_PORT 0x2000
#define ALTF_NFSV2 0x4000
#define ALTF_NOAC 0x8000
+#define ALTF_ACREGMIN 0x10000
+#define ALTF_ACREGMAX 0x20000
+#define ALTF_ACDIRMIN 0x40000
+#define ALTF_ACDIRMAX 0x80000
const struct mntopt mopts[] = {
MOPT_STDOPTS,
@@ -118,6 +122,10 @@ const struct mntopt mopts[] = {
{ "port", 0, ALTF_PORT, 1 },
{ "nfsv2", 0, ALTF_NFSV2, 1 },
{ "ac", 1, ALTF_NOAC, 1 },
+ { "acregmin", 0, ALTF_ACREGMIN, 1},
+ { "acregmax", 0, ALTF_ACREGMAX, 1},
+ { "acdirmin", 0, ALTF_ACDIRMIN, 1},
+ { "acdirmax", 0, ALTF_ACDIRMAX, 1},
{ NULL }
};
@@ -303,6 +311,26 @@ main(int argc, char *argv[])
nfsargsp->acdirmin = 0;
nfsargsp->acdirmax = 0;
}
+ if (altflags & ALTF_ACREGMIN) {
+ nfsargsp->flags |= NFSMNT_ACREGMIN;
+ nfsargsp->acregmin =
+ atoi(strstr(optarg, "acregmin=") + 9);
+ }
+ if (altflags & ALTF_ACREGMAX) {
+ nfsargsp->flags |= NFSMNT_ACREGMAX;
+ nfsargsp->acregmax =
+ atoi(strstr(optarg, "acregmax=") + 9);
+ }
+ if (altflags & ALTF_ACDIRMIN) {
+ nfsargsp->flags |= NFSMNT_ACDIRMIN;
+ nfsargsp->acdirmin =
+ atoi(strstr(optarg, "acdirmin=") + 9);
+ }
+ if (altflags & ALTF_ACDIRMAX) {
+ nfsargsp->flags |= NFSMNT_ACDIRMAX;
+ nfsargsp->acdirmax =
+ atoi(strstr(optarg, "acdirmax=") + 9);
+ }
altflags = 0;
break;
case 'P':