diff options
author | peter <peter@FreeBSD.org> | 1998-05-19 07:11:27 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-05-19 07:11:27 +0000 |
commit | 1777a04b110cd58eb32d0ad81d7cce33566c30ed (patch) | |
tree | 7d6f8932bbfd01ff67fabaef4fb555fd79ab7cc9 /sys/nfsclient | |
parent | 56469e323e07fbfcd1eb45391d45c0a509b8bbe0 (diff) | |
download | FreeBSD-src-1777a04b110cd58eb32d0ad81d7cce33566c30ed.zip FreeBSD-src-1777a04b110cd58eb32d0ad81d7cce33566c30ed.tar.gz |
Allow control of the attribute cache timeouts at mount time.
We had run out of bits in the nfs mount flags, I have moved the internal
state flags into a seperate variable. These are no longer visible via
statfs(), but I don't know of anything that looks at them.
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs.h | 61 | ||||
-rw-r--r-- | sys/nfsclient/nfs_bio.c | 8 | ||||
-rw-r--r-- | sys/nfsclient/nfs_nfsiod.c | 37 | ||||
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 69 | ||||
-rw-r--r-- | sys/nfsclient/nfs_subs.c | 49 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 127 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 9 | ||||
-rw-r--r-- | sys/nfsclient/nfsargs.h | 61 | ||||
-rw-r--r-- | sys/nfsclient/nfsmount.h | 7 | ||||
-rw-r--r-- | sys/nfsclient/nfsstats.h | 61 |
10 files changed, 293 insertions, 196 deletions
diff --git a/sys/nfsclient/nfs.h b/sys/nfsclient/nfs.h index 8b28c00..ad606ad 100644 --- a/sys/nfsclient/nfs.h +++ b/sys/nfsclient/nfs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.4 (Berkeley) 5/1/95 - * $Id: nfs.h,v 1.33 1998/02/01 21:23:29 bde Exp $ + * $Id: nfs.h,v 1.34 1998/03/30 09:53:43 phk Exp $ */ #ifndef _NFS_NFS_H_ @@ -56,11 +56,17 @@ #define NFS_RETRANS 10 /* Num of retrans for soft mounts */ #define NFS_MAXGRPS 16 /* Max. size of groups list */ #ifndef NFS_MINATTRTIMO -#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */ +#define NFS_MINATTRTIMO 3 /* VREG attrib cache timeout in sec */ #endif #ifndef NFS_MAXATTRTIMO #define NFS_MAXATTRTIMO 60 #endif +#ifndef NFS_MINDIRATTRTIMO +#define NFS_MINDIRATTRTIMO 30 /* VDIR attrib cache timeout in sec */ +#endif +#ifndef NFS_MAXDIRATTRTIMO +#define NFS_MAXDIRATTRTIMO 60 +#endif #define NFS_WSIZE 8192 /* Def. write data size <= 8192 */ #define NFS_RSIZE 8192 /* Def. read data size <= 8192 */ #define NFS_READDIRSIZE 8192 /* Def. readdir size */ @@ -104,15 +110,6 @@ #endif /* - * Set the attribute timeout based on how recently the file has been modified. - */ -#define NFS_ATTRTIMEO(np) \ - ((((np)->n_flag & NMODIFIED) || \ - (time_second - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \ - ((time_second - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \ - (time_second - (np)->n_mtime) / 10)) - -/* * Expected allocation sizes for major data structures. If the actual size * of the structure exceeds these sizes, then malloc() will be allocating * almost twice the memory required. This is used in nfs_init() to warn @@ -149,6 +146,10 @@ struct nfs_args { int leaseterm; /* Term (sec) of lease */ int deadthresh; /* Retrans threshold */ char *hostname; /* server's name */ + int acregmin; /* cache attrs for reg files min time */ + int acregmax; /* cache attrs for reg files max time */ + int acdirmin; /* cache attrs for dirs min time */ + int acdirmax; /* cache attrs for dirs max time */ }; /* @@ -172,21 +173,25 @@ struct nfs_args { #define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */ #define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */ #define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */ -#define NFSMNT_INTERNAL 0xfffc0000 /* Bits set internally */ -#define NFSMNT_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */ -#define NFSMNT_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */ -#define NFSMNT_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */ -#define NFSMNT_MNTD 0x00200000 /* Mnt server for mnt point */ -#define NFSMNT_DISMINPROG 0x00400000 /* Dismount in progress */ -#define NFSMNT_DISMNT 0x00800000 /* Dismounted */ -#define NFSMNT_SNDLOCK 0x01000000 /* Send socket lock */ -#define NFSMNT_WANTSND 0x02000000 /* Want above */ -#define NFSMNT_RCVLOCK 0x04000000 /* Rcv socket lock */ -#define NFSMNT_WANTRCV 0x08000000 /* Want above */ -#define NFSMNT_WAITAUTH 0x10000000 /* Wait for authentication */ -#define NFSMNT_HASAUTH 0x20000000 /* Has authenticator */ -#define NFSMNT_WANTAUTH 0x40000000 /* Wants an authenticator */ -#define NFSMNT_AUTHERR 0x80000000 /* Authentication error */ +#define NFSMNT_ACREGMIN 0x00040000 +#define NFSMNT_ACREGMAX 0x00080000 +#define NFSMNT_ACDIRMIN 0x00100000 +#define NFSMNT_ACDIRMAX 0x00200000 + +#define NFSSTA_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */ +#define NFSSTA_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */ +#define NFSSTA_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */ +#define NFSSTA_MNTD 0x00200000 /* Mnt server for mnt point */ +#define NFSSTA_DISMINPROG 0x00400000 /* Dismount in progress */ +#define NFSSTA_DISMNT 0x00800000 /* Dismounted */ +#define NFSSTA_SNDLOCK 0x01000000 /* Send socket lock */ +#define NFSSTA_WANTSND 0x02000000 /* Want above */ +#define NFSSTA_RCVLOCK 0x04000000 /* Rcv socket lock */ +#define NFSSTA_WANTRCV 0x08000000 /* Want above */ +#define NFSSTA_WAITAUTH 0x10000000 /* Wait for authentication */ +#define NFSSTA_HASAUTH 0x20000000 /* Has authenticator */ +#define NFSSTA_WANTAUTH 0x40000000 /* Wants an authenticator */ +#define NFSSTA_AUTHERR 0x80000000 /* Authentication error */ /* * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs @@ -580,8 +585,8 @@ int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *, int nfs_rephead __P((int, struct nfsrv_descript *, struct nfssvc_sock *, int, int, u_quad_t *, struct mbuf **, struct mbuf **, caddr_t *)); -int nfs_sndlock __P((int *, struct nfsreq *)); -void nfs_sndunlock __P((int *flagp)); +int nfs_sndlock __P((int *, int *, struct nfsreq *)); +void nfs_sndunlock __P((int *, int *)); int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *)); int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *, int)); diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index 46020e5..544ba32 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95 - * $Id: nfs_bio.c,v 1.53 1998/03/08 09:57:54 julian Exp $ + * $Id: nfs_bio.c,v 1.54 1998/03/28 16:05:05 steve Exp $ */ @@ -257,7 +257,8 @@ nfs_bioread(vp, uio, ioflag, cred, getpages) if (uio->uio_offset < 0) return (EINVAL); p = uio->uio_procp; - if ((nmp->nm_flag & (NFSMNT_NFSV3 | NFSMNT_GOTFSINFO)) == NFSMNT_NFSV3) + if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && + (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) (void)nfs_fsinfo(nmp, vp, cred, p); biosize = vp->v_mount->mnt_stat.f_iosize; /* @@ -636,7 +637,8 @@ nfs_write(ap) np->n_flag &= ~NWRITEERR; return (np->n_error); } - if ((nmp->nm_flag & (NFSMNT_NFSV3 | NFSMNT_GOTFSINFO)) == NFSMNT_NFSV3) + if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && + (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) (void)nfs_fsinfo(nmp, vp, cred, p); if (ioflag & (IO_APPEND | IO_SYNC)) { if (np->n_flag & NMODIFIED) { diff --git a/sys/nfsclient/nfs_nfsiod.c b/sys/nfsclient/nfs_nfsiod.c index c2f9071..317b1c0 100644 --- a/sys/nfsclient/nfs_nfsiod.c +++ b/sys/nfsclient/nfs_nfsiod.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95 - * $Id: nfs_syscalls.c,v 1.36 1998/02/09 06:10:37 eivind Exp $ + * $Id: nfs_syscalls.c,v 1.37 1998/03/30 09:54:17 phk Exp $ */ #include <sys/param.h> @@ -223,10 +223,10 @@ nfssvc(p, uap) vput(nd.ni_vp); if (error) return (error); - if ((nmp->nm_flag & NFSMNT_MNTD) && + if ((nmp->nm_state & NFSSTA_MNTD) && (uap->flag & NFSSVC_GOTAUTH) == 0) return (0); - nmp->nm_flag |= NFSMNT_MNTD; + nmp->nm_state |= NFSSTA_MNTD; error = nqnfs_clientd(nmp, p->p_ucred, &ncd, uap->flag, uap->argp, p); } else if (uap->flag & NFSSVC_ADDSOCK) { @@ -514,10 +514,12 @@ nfssvc_nfsd(nsd, argp, p) else if (slp->ns_flag & SLP_NEEDQ) { slp->ns_flag &= ~SLP_NEEDQ; (void) nfs_sndlock(&slp->ns_solock, + &slp->ns_solock, (struct nfsreq *)0); nfsrv_rcv(slp->ns_so, (caddr_t)slp, M_WAIT); - nfs_sndunlock(&slp->ns_solock); + nfs_sndunlock(&slp->ns_solock, + &slp->ns_solock); } error = nfsrv_dorec(slp, nfsd, &nd); cur_usec = nfs_curusec(); @@ -677,7 +679,8 @@ nfssvc_nfsd(nsd, argp, p) *mtod(m, u_long *) = htonl(0x80000000 | siz); } if (solockp) - (void) nfs_sndlock(solockp, (struct nfsreq *)0); + (void) nfs_sndlock(solockp, solockp, + (struct nfsreq *)0); if (slp->ns_flag & SLP_VALID) error = nfs_send(so, nd->nd_nam2, m, NULL); else { @@ -693,7 +696,7 @@ nfssvc_nfsd(nsd, argp, p) if (error == EPIPE) nfsrv_zapsock(slp); if (solockp) - nfs_sndunlock(solockp); + nfs_sndunlock(solockp, solockp); if (error == EINTR || error == ERESTART) { free((caddr_t)nd, M_NFSRVDESC); nfsrv_slpderef(slp); @@ -899,17 +902,17 @@ nfs_getauth(nmp, rep, cred, auth_str, auth_len, verf_str, verf_len, key) { int error = 0; - while ((nmp->nm_flag & NFSMNT_WAITAUTH) == 0) { - nmp->nm_flag |= NFSMNT_WANTAUTH; + while ((nmp->nm_state & NFSSTA_WAITAUTH) == 0) { + nmp->nm_state |= NFSSTA_WANTAUTH; (void) tsleep((caddr_t)&nmp->nm_authtype, PSOCK, "nfsauth1", 2 * hz); error = nfs_sigintr(nmp, rep, rep->r_procp); if (error) { - nmp->nm_flag &= ~NFSMNT_WANTAUTH; + nmp->nm_state &= ~NFSSTA_WANTAUTH; return (error); } } - nmp->nm_flag &= ~(NFSMNT_WAITAUTH | NFSMNT_WANTAUTH); + nmp->nm_state &= ~(NFSSTA_WAITAUTH | NFSSTA_WANTAUTH); nmp->nm_authstr = *auth_str = (char *)malloc(RPCAUTH_MAXSIZ, M_TEMP, M_WAITOK); nmp->nm_authlen = RPCAUTH_MAXSIZ; nmp->nm_verfstr = verf_str; @@ -920,13 +923,13 @@ nfs_getauth(nmp, rep, cred, auth_str, auth_len, verf_str, verf_len, key) /* * And wait for mount_nfs to do its stuff. */ - while ((nmp->nm_flag & NFSMNT_HASAUTH) == 0 && error == 0) { + while ((nmp->nm_state & NFSSTA_HASAUTH) == 0 && error == 0) { (void) tsleep((caddr_t)&nmp->nm_authlen, PSOCK, "nfsauth2", 2 * hz); error = nfs_sigintr(nmp, rep, rep->r_procp); } - if (nmp->nm_flag & NFSMNT_AUTHERR) { - nmp->nm_flag &= ~NFSMNT_AUTHERR; + if (nmp->nm_state & NFSSTA_AUTHERR) { + nmp->nm_state &= ~NFSSTA_AUTHERR; error = EAUTH; } if (error) @@ -936,10 +939,10 @@ nfs_getauth(nmp, rep, cred, auth_str, auth_len, verf_str, verf_len, key) *verf_len = nmp->nm_verflen; bcopy((caddr_t)nmp->nm_key, (caddr_t)key, sizeof (key)); } - nmp->nm_flag &= ~NFSMNT_HASAUTH; - nmp->nm_flag |= NFSMNT_WAITAUTH; - if (nmp->nm_flag & NFSMNT_WANTAUTH) { - nmp->nm_flag &= ~NFSMNT_WANTAUTH; + nmp->nm_state &= ~NFSSTA_HASAUTH; + nmp->nm_state |= NFSSTA_WAITAUTH; + if (nmp->nm_state & NFSSTA_WANTAUTH) { + nmp->nm_state &= ~NFSSTA_WANTAUTH; wakeup((caddr_t)&nmp->nm_authtype); } return (error); diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 5c084b7..3fe0cec 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95 - * $Id: nfs_socket.c,v 1.30 1997/10/28 15:59:07 bde Exp $ + * $Id: nfs_socket.c,v 1.31 1998/03/30 09:54:04 phk Exp $ */ /* @@ -136,7 +136,7 @@ struct nfsrtt nfsrtt; static int nfs_msg __P((struct proc *,char *,char *)); static int nfs_rcvlock __P((struct nfsreq *)); -static void nfs_rcvunlock __P((int *flagp)); +static void nfs_rcvunlock __P((int *flagp, int *statep)); static void nfs_realign __P((struct mbuf *m, int hsiz)); static int nfs_receive __P((struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)); @@ -483,7 +483,8 @@ nfs_receive(rep, aname, mp) * until we have an entire rpc request/reply. */ if (sotype != SOCK_DGRAM) { - error = nfs_sndlock(&rep->r_nmp->nm_flag, rep); + error = nfs_sndlock(&rep->r_nmp->nm_flag, &rep->r_nmp->nm_state, + rep); if (error) return (error); tryagain: @@ -497,14 +498,16 @@ tryagain: * mount point. */ if (rep->r_mrep || (rep->r_flags & R_SOFTTERM)) { - nfs_sndunlock(&rep->r_nmp->nm_flag); + nfs_sndunlock(&rep->r_nmp->nm_flag, + &rep->r_nmp->nm_state); return (EINTR); } so = rep->r_nmp->nm_so; if (!so) { error = nfs_reconnect(rep); if (error) { - nfs_sndunlock(&rep->r_nmp->nm_flag); + nfs_sndunlock(&rep->r_nmp->nm_flag, + &rep->r_nmp->nm_state); return (error); } goto tryagain; @@ -516,13 +519,14 @@ tryagain: if (error) { if (error == EINTR || error == ERESTART || (error = nfs_reconnect(rep))) { - nfs_sndunlock(&rep->r_nmp->nm_flag); + nfs_sndunlock(&rep->r_nmp->nm_flag, + &rep->r_nmp->nm_state); return (error); } goto tryagain; } } - nfs_sndunlock(&rep->r_nmp->nm_flag); + nfs_sndunlock(&rep->r_nmp->nm_flag, &rep->r_nmp->nm_state); if (sotype == SOCK_STREAM) { aio.iov_base = (caddr_t) &len; aio.iov_len = sizeof(u_long); @@ -621,7 +625,8 @@ errout: "receive error %d from nfs server %s\n", error, rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname); - error = nfs_sndlock(&rep->r_nmp->nm_flag, rep); + error = nfs_sndlock(&rep->r_nmp->nm_flag, + &rep->r_nmp->nm_state, rep); if (!error) error = nfs_reconnect(rep); if (!error) @@ -704,7 +709,7 @@ nfs_reply(myrep) * Get the next Rpc reply off the socket */ error = nfs_receive(myrep, &nam, &mrep); - nfs_rcvunlock(&nmp->nm_flag); + nfs_rcvunlock(&nmp->nm_flag, &nmp->nm_state); if (error) { /* @@ -964,12 +969,12 @@ tryagain: nmp->nm_sent < nmp->nm_cwnd)) { splx(s); if (nmp->nm_soflags & PR_CONNREQUIRED) - error = nfs_sndlock(&nmp->nm_flag, rep); + error = nfs_sndlock(&nmp->nm_flag, &nmp->nm_state, rep); if (!error) { m = m_copym(m, 0, M_COPYALL, M_WAIT); error = nfs_send(nmp->nm_so, nmp->nm_nam, m, rep); if (nmp->nm_soflags & PR_CONNREQUIRED) - nfs_sndunlock(&nmp->nm_flag); + nfs_sndunlock(&nmp->nm_flag, &nmp->nm_state); } if (!error && (rep->r_flags & R_MUSTRESEND) == 0) { nmp->nm_sent += NFS_CWNDSCALE; @@ -1445,8 +1450,9 @@ nfs_sigintr(nmp, rep, p) * in progress when a reconnect is necessary. */ int -nfs_sndlock(flagp, rep) +nfs_sndlock(flagp, statep, rep) register int *flagp; + register int *statep; struct nfsreq *rep; { struct proc *p; @@ -1458,18 +1464,18 @@ nfs_sndlock(flagp, rep) slpflag = PCATCH; } else p = (struct proc *)0; - while (*flagp & NFSMNT_SNDLOCK) { + while (*statep & NFSSTA_SNDLOCK) { if (nfs_sigintr(rep->r_nmp, rep, p)) return (EINTR); - *flagp |= NFSMNT_WANTSND; - (void) tsleep((caddr_t)flagp, slpflag | (PZERO - 1), "nfsndlck", - slptimeo); + *statep |= NFSSTA_WANTSND; + (void) tsleep((caddr_t)flagp, slpflag | (PZERO - 1), + "nfsndlck", slptimeo); if (slpflag == PCATCH) { slpflag = 0; slptimeo = 2 * hz; } } - *flagp |= NFSMNT_SNDLOCK; + *statep |= NFSSTA_SNDLOCK; return (0); } @@ -1477,15 +1483,16 @@ nfs_sndlock(flagp, rep) * Unlock the stream socket for others. */ void -nfs_sndunlock(flagp) +nfs_sndunlock(flagp, statep) register int *flagp; + register int *statep; { - if ((*flagp & NFSMNT_SNDLOCK) == 0) + if ((*statep & NFSSTA_SNDLOCK) == 0) panic("nfs sndunlock"); - *flagp &= ~NFSMNT_SNDLOCK; - if (*flagp & NFSMNT_WANTSND) { - *flagp &= ~NFSMNT_WANTSND; + *statep &= ~NFSSTA_SNDLOCK; + if (*statep & NFSSTA_WANTSND) { + *statep &= ~NFSSTA_WANTSND; wakeup((caddr_t)flagp); } } @@ -1495,16 +1502,17 @@ nfs_rcvlock(rep) register struct nfsreq *rep; { register int *flagp = &rep->r_nmp->nm_flag; + register int *statep = &rep->r_nmp->nm_state; int slpflag, slptimeo = 0; if (*flagp & NFSMNT_INT) slpflag = PCATCH; else slpflag = 0; - while (*flagp & NFSMNT_RCVLOCK) { + while (*statep & NFSSTA_RCVLOCK) { if (nfs_sigintr(rep->r_nmp, rep, rep->r_procp)) return (EINTR); - *flagp |= NFSMNT_WANTRCV; + *statep |= NFSSTA_WANTRCV; (void) tsleep((caddr_t)flagp, slpflag | (PZERO - 1), "nfsrcvlk", slptimeo); /* @@ -1520,7 +1528,7 @@ nfs_rcvlock(rep) slptimeo = 2 * hz; } } - *flagp |= NFSMNT_RCVLOCK; + *statep |= NFSSTA_RCVLOCK; return (0); } @@ -1528,15 +1536,16 @@ nfs_rcvlock(rep) * Unlock the stream socket for others. */ static void -nfs_rcvunlock(flagp) +nfs_rcvunlock(flagp, statep) register int *flagp; + register int *statep; { - if ((*flagp & NFSMNT_RCVLOCK) == 0) + if ((*statep & NFSSTA_RCVLOCK) == 0) panic("nfs rcvunlock"); - *flagp &= ~NFSMNT_RCVLOCK; - if (*flagp & NFSMNT_WANTRCV) { - *flagp &= ~NFSMNT_WANTRCV; + *statep &= ~NFSSTA_RCVLOCK; + if (*statep & NFSSTA_WANTRCV) { + *statep &= ~NFSSTA_WANTRCV; wakeup((caddr_t)flagp); } } diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index f9eabdd..b81eedf 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.52 1998/03/30 09:54:12 phk Exp $ + * $Id: nfs_subs.c,v 1.53 1998/04/06 11:41:07 phk Exp $ */ /* @@ -1363,6 +1363,12 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper) return (0); } +#ifdef NFS_ACDEBUG +#include <sys/sysctl.h> +static int nfs_acdebug; +SYSCTL_INT(_vfs_nfs, OID_AUTO, acdebug, CTLFLAG_RW, &nfs_acdebug, 0, ""); +#endif + /* * Check the time stamp * If the cache is valid, copy contents to *vap and return 0 @@ -1373,15 +1379,50 @@ nfs_getattrcache(vp, vaper) register struct vnode *vp; struct vattr *vaper; { - register struct nfsnode *np = VTONFS(vp); + register struct nfsnode *np; register struct vattr *vap; + struct nfsmount *nmp; + int timeo; - if ((time_second - np->n_attrstamp) >= NFS_ATTRTIMEO(np)) { + np = VTONFS(vp); + vap = &np->n_vattr; + nmp = VFSTONFS(vp->v_mount); + /* XXX n_mtime doesn't seem to be updated on a miss-and-reload */ + timeo = (time_second - np->n_mtime) / 10; + +#ifdef NFS_ACDEBUG + if (nfs_acdebug>1) + printf("nfs_getattrcache: initial timeo = %d\n", timeo); +#endif + + if (vap->va_type == VDIR) { + if ((np->n_flag & NMODIFIED) || timeo < nmp->nm_acdirmin) + timeo = nmp->nm_acdirmin; + else if (timeo > nmp->nm_acdirmax) + timeo = nmp->nm_acdirmax; + } else { + if ((np->n_flag & NMODIFIED) || timeo < nmp->nm_acregmin) + timeo = nmp->nm_acregmin; + else if (timeo > nmp->nm_acregmax) + timeo = nmp->nm_acregmax; + } + +#ifdef NFS_ACDEBUG + if (nfs_acdebug > 2) + printf("acregmin %d; acregmax %d; acdirmin %d; acdirmax %d\n", + nmp->nm_acregmin, nmp->nm_acregmax, + nmp->nm_acdirmin, nmp->nm_acdirmax); + + if (nfs_acdebug) + printf("nfs_getattrcache: age = %d; final timeo = %d\n",r + (time_second - np->n_attrstamp), timeo); +#endif + + if ((time_second - np->n_attrstamp) >= timeo) { nfsstats.attrcache_misses++; return (ENOENT); } nfsstats.attrcache_hits++; - vap = &np->n_vattr; if (vap->va_size != np->n_size) { if (vap->va_type == VREG) { if (np->n_flag & NMODIFIED) { diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index e108dcf..eb577d2 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95 - * $Id: nfs_vfsops.c,v 1.57 1998/03/30 09:54:23 phk Exp $ + * $Id: nfs_vfsops.c,v 1.58 1998/05/06 05:29:38 msmith Exp $ */ #include <sys/param.h> @@ -166,7 +166,8 @@ static void nfs_convert_diskless __P((void)); static void nfs_convert_oargs __P((struct nfs_args *args, struct onfs_args *oargs)); -static int nfs_iosize(nmp) +static int +nfs_iosize(nmp) struct nfsmount* nmp; { int iosize; @@ -182,58 +183,57 @@ static int nfs_iosize(nmp) return iosize; } -static void nfs_convert_oargs(args,oargs) - struct nfs_args *args; - struct onfs_args *oargs; +static void +nfs_convert_oargs(args, oargs) + struct nfs_args *args; + struct onfs_args *oargs; { - args->version = NFS_ARGSVERSION; - args->addr = oargs->addr; - args->addrlen = oargs->addrlen; - args->sotype = oargs->sotype; - args->proto = oargs->proto; - args->fh = oargs->fh; - args->fhsize = oargs->fhsize; - args->flags = oargs->flags; - args->wsize = oargs->wsize; - args->rsize = oargs->rsize; - args->readdirsize = oargs->readdirsize; - args->timeo = oargs->timeo; - args->retrans = oargs->retrans; - args->maxgrouplist = oargs->maxgrouplist; - args->readahead = oargs->readahead; - args->leaseterm = oargs->leaseterm; - args->deadthresh = oargs->deadthresh; - args->hostname = oargs->hostname; + args->version = NFS_ARGSVERSION; + args->addr = oargs->addr; + args->addrlen = oargs->addrlen; + args->sotype = oargs->sotype; + args->proto = oargs->proto; + args->fh = oargs->fh; + args->fhsize = oargs->fhsize; + args->flags = oargs->flags; + args->wsize = oargs->wsize; + args->rsize = oargs->rsize; + args->readdirsize = oargs->readdirsize; + args->timeo = oargs->timeo; + args->retrans = oargs->retrans; + args->maxgrouplist = oargs->maxgrouplist; + args->readahead = oargs->readahead; + args->leaseterm = oargs->leaseterm; + args->deadthresh = oargs->deadthresh; + args->hostname = oargs->hostname; } static void nfs_convert_diskless() { - bcopy(&nfs_diskless.myif, &nfsv3_diskless.myif, - sizeof(struct ifaliasreq)); - bcopy(&nfs_diskless.mygateway, &nfsv3_diskless.mygateway, - sizeof(struct sockaddr_in)); - nfs_convert_oargs(&nfsv3_diskless.swap_args,&nfs_diskless.swap_args); - nfsv3_diskless.swap_fhsize = NFSX_V2FH; - bcopy(nfs_diskless.swap_fh,nfsv3_diskless.swap_fh,NFSX_V2FH); - bcopy(&nfs_diskless.swap_saddr,&nfsv3_diskless.swap_saddr, - sizeof(struct sockaddr_in)); - bcopy(nfs_diskless.swap_hostnam,nfsv3_diskless.swap_hostnam, - MNAMELEN); - nfsv3_diskless.swap_nblks = nfs_diskless.swap_nblks; - bcopy(&nfs_diskless.swap_ucred, &nfsv3_diskless.swap_ucred, - sizeof(struct ucred)); - nfs_convert_oargs(&nfsv3_diskless.root_args,&nfs_diskless.root_args); - nfsv3_diskless.root_fhsize = NFSX_V2FH; - bcopy(nfs_diskless.root_fh,nfsv3_diskless.root_fh,NFSX_V2FH); - bcopy(&nfs_diskless.root_saddr,&nfsv3_diskless.root_saddr, - sizeof(struct sockaddr_in)); - bcopy(nfs_diskless.root_hostnam,nfsv3_diskless.root_hostnam, - MNAMELEN); - nfsv3_diskless.root_time = nfs_diskless.root_time; - bcopy(nfs_diskless.my_hostnam,nfsv3_diskless.my_hostnam, - MAXHOSTNAMELEN); - nfs_diskless_valid = 3; + bcopy(&nfs_diskless.myif, &nfsv3_diskless.myif, + sizeof(struct ifaliasreq)); + bcopy(&nfs_diskless.mygateway, &nfsv3_diskless.mygateway, + sizeof(struct sockaddr_in)); + nfs_convert_oargs(&nfsv3_diskless.swap_args,&nfs_diskless.swap_args); + nfsv3_diskless.swap_fhsize = NFSX_V2FH; + bcopy(nfs_diskless.swap_fh,nfsv3_diskless.swap_fh,NFSX_V2FH); + bcopy(&nfs_diskless.swap_saddr,&nfsv3_diskless.swap_saddr, + sizeof(struct sockaddr_in)); + bcopy(nfs_diskless.swap_hostnam,nfsv3_diskless.swap_hostnam, MNAMELEN); + nfsv3_diskless.swap_nblks = nfs_diskless.swap_nblks; + bcopy(&nfs_diskless.swap_ucred, &nfsv3_diskless.swap_ucred, + sizeof(struct ucred)); + nfs_convert_oargs(&nfsv3_diskless.root_args,&nfs_diskless.root_args); + nfsv3_diskless.root_fhsize = NFSX_V2FH; + bcopy(nfs_diskless.root_fh,nfsv3_diskless.root_fh,NFSX_V2FH); + bcopy(&nfs_diskless.root_saddr,&nfsv3_diskless.root_saddr, + sizeof(struct sockaddr_in)); + bcopy(nfs_diskless.root_hostnam,nfsv3_diskless.root_hostnam, MNAMELEN); + nfsv3_diskless.root_time = nfs_diskless.root_time; + bcopy(nfs_diskless.my_hostnam,nfsv3_diskless.my_hostnam, + MAXHOSTNAMELEN); + nfs_diskless_valid = 3; } /* @@ -267,7 +267,7 @@ nfs_statfs(mp, sbp, p) vp = NFSTOV(np); cred = crget(); cred->cr_ngroups = 1; - if (v3 && (nmp->nm_flag & NFSMNT_GOTFSINFO) == 0) + if (v3 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) (void)nfs_fsinfo(nmp, vp, cred, p); nfsstats.rpccnt[NFSPROC_FSSTAT]++; nfsm_reqhead(vp, NFSPROC_FSSTAT, NFSX_FH(v3)); @@ -364,7 +364,7 @@ nfs_fsinfo(nmp, vp, cred, p) if (max < nmp->nm_readdirsize) { nmp->nm_readdirsize = max; } - nmp->nm_flag |= NFSMNT_GOTFSINFO; + nmp->nm_state |= NFSSTA_GOTFSINFO; } nfsm_reqdone; return (error); @@ -766,6 +766,27 @@ mountnfs(argp, mp, nam, pth, hst, vpp) if (nmp->nm_readdirsize > nmp->nm_rsize) nmp->nm_readdirsize = nmp->nm_rsize; + if ((argp->flags & NFSMNT_ACREGMIN) && argp->acregmin >= 0) + nmp->nm_acregmin = argp->acregmin; + else + nmp->nm_acregmin = NFS_MINATTRTIMO; + if ((argp->flags & NFSMNT_ACREGMAX) && argp->acregmax >= 0) + nmp->nm_acregmax = argp->acregmax; + else + nmp->nm_acregmax = NFS_MAXATTRTIMO; + if ((argp->flags & NFSMNT_ACDIRMIN) && argp->acdirmin >= 0) + nmp->nm_acdirmin = argp->acdirmin; + else + nmp->nm_acdirmin = NFS_MINDIRATTRTIMO; + if ((argp->flags & NFSMNT_ACDIRMAX) && argp->acdirmax >= 0) + nmp->nm_acdirmax = argp->acdirmax; + else + nmp->nm_acdirmax = NFS_MAXDIRATTRTIMO; + if (nmp->nm_acdirmin > nmp->nm_acdirmax) + nmp->nm_acdirmin = nmp->nm_acdirmax; + if (nmp->nm_acregmin > nmp->nm_acregmax) + nmp->nm_acregmin = nmp->nm_acregmax; + if ((argp->flags & NFSMNT_MAXGRPS) && argp->maxgrouplist >= 0 && argp->maxgrouplist <= NFS_MAXGRPS) nmp->nm_numgrps = argp->maxgrouplist; @@ -872,13 +893,13 @@ nfs_unmount(mp, mntflags, p) /* * Must handshake with nqnfs_clientd() if it is active. */ - nmp->nm_flag |= NFSMNT_DISMINPROG; + nmp->nm_state |= NFSSTA_DISMINPROG; while (nmp->nm_inprog != NULLVP) (void) tsleep((caddr_t)&lbolt, PSOCK, "nfsdism", 0); error = vflush(mp, vp, flags); if (error) { vput(vp); - nmp->nm_flag &= ~NFSMNT_DISMINPROG; + nmp->nm_state &= ~NFSSTA_DISMINPROG; return (error); } @@ -887,7 +908,7 @@ nfs_unmount(mp, mntflags, p) * For NQNFS, let the server daemon free the nfsmount structure. */ if (nmp->nm_flag & (NFSMNT_NQNFS | NFSMNT_KERB)) - nmp->nm_flag |= NFSMNT_DISMNT; + nmp->nm_state |= NFSSTA_DISMNT; /* * There are two reference counts and one lock to get rid of here. diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index c8d99a9..246757f 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.87 1998/05/16 16:03:10 bde Exp $ + * $Id: nfs_vnops.c,v 1.88 1998/05/16 16:20:50 bde Exp $ */ @@ -1146,10 +1146,11 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit) else if (committed == NFSV3WRITE_DATASYNC && commit == NFSV3WRITE_UNSTABLE) committed = commit; - if ((nmp->nm_flag & NFSMNT_HASWRITEVERF) == 0) { + if ((nmp->nm_state & NFSSTA_HASWRITEVERF) == 0) + { bcopy((caddr_t)tl, (caddr_t)nmp->nm_verf, NFSX_V3WRITEVERF); - nmp->nm_flag |= NFSMNT_HASWRITEVERF; + nmp->nm_state |= NFSSTA_HASWRITEVERF; } else if (bcmp((caddr_t)tl, (caddr_t)nmp->nm_verf, NFSX_V3WRITEVERF)) { *must_commit = 1; @@ -2531,7 +2532,7 @@ nfs_commit(vp, offset, cnt, cred, procp) int error = 0, wccflag = NFSV3_WCCRATTR; struct mbuf *mreq, *mrep, *md, *mb, *mb2; - if ((nmp->nm_flag & NFSMNT_HASWRITEVERF) == 0) + if ((nmp->nm_state & NFSSTA_HASWRITEVERF) == 0) return (0); nfsstats.rpccnt[NFSPROC_COMMIT]++; nfsm_reqhead(vp, NFSPROC_COMMIT, NFSX_FH(1)); diff --git a/sys/nfsclient/nfsargs.h b/sys/nfsclient/nfsargs.h index 8b28c00..ad606ad 100644 --- a/sys/nfsclient/nfsargs.h +++ b/sys/nfsclient/nfsargs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.4 (Berkeley) 5/1/95 - * $Id: nfs.h,v 1.33 1998/02/01 21:23:29 bde Exp $ + * $Id: nfs.h,v 1.34 1998/03/30 09:53:43 phk Exp $ */ #ifndef _NFS_NFS_H_ @@ -56,11 +56,17 @@ #define NFS_RETRANS 10 /* Num of retrans for soft mounts */ #define NFS_MAXGRPS 16 /* Max. size of groups list */ #ifndef NFS_MINATTRTIMO -#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */ +#define NFS_MINATTRTIMO 3 /* VREG attrib cache timeout in sec */ #endif #ifndef NFS_MAXATTRTIMO #define NFS_MAXATTRTIMO 60 #endif +#ifndef NFS_MINDIRATTRTIMO +#define NFS_MINDIRATTRTIMO 30 /* VDIR attrib cache timeout in sec */ +#endif +#ifndef NFS_MAXDIRATTRTIMO +#define NFS_MAXDIRATTRTIMO 60 +#endif #define NFS_WSIZE 8192 /* Def. write data size <= 8192 */ #define NFS_RSIZE 8192 /* Def. read data size <= 8192 */ #define NFS_READDIRSIZE 8192 /* Def. readdir size */ @@ -104,15 +110,6 @@ #endif /* - * Set the attribute timeout based on how recently the file has been modified. - */ -#define NFS_ATTRTIMEO(np) \ - ((((np)->n_flag & NMODIFIED) || \ - (time_second - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \ - ((time_second - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \ - (time_second - (np)->n_mtime) / 10)) - -/* * Expected allocation sizes for major data structures. If the actual size * of the structure exceeds these sizes, then malloc() will be allocating * almost twice the memory required. This is used in nfs_init() to warn @@ -149,6 +146,10 @@ struct nfs_args { int leaseterm; /* Term (sec) of lease */ int deadthresh; /* Retrans threshold */ char *hostname; /* server's name */ + int acregmin; /* cache attrs for reg files min time */ + int acregmax; /* cache attrs for reg files max time */ + int acdirmin; /* cache attrs for dirs min time */ + int acdirmax; /* cache attrs for dirs max time */ }; /* @@ -172,21 +173,25 @@ struct nfs_args { #define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */ #define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */ #define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */ -#define NFSMNT_INTERNAL 0xfffc0000 /* Bits set internally */ -#define NFSMNT_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */ -#define NFSMNT_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */ -#define NFSMNT_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */ -#define NFSMNT_MNTD 0x00200000 /* Mnt server for mnt point */ -#define NFSMNT_DISMINPROG 0x00400000 /* Dismount in progress */ -#define NFSMNT_DISMNT 0x00800000 /* Dismounted */ -#define NFSMNT_SNDLOCK 0x01000000 /* Send socket lock */ -#define NFSMNT_WANTSND 0x02000000 /* Want above */ -#define NFSMNT_RCVLOCK 0x04000000 /* Rcv socket lock */ -#define NFSMNT_WANTRCV 0x08000000 /* Want above */ -#define NFSMNT_WAITAUTH 0x10000000 /* Wait for authentication */ -#define NFSMNT_HASAUTH 0x20000000 /* Has authenticator */ -#define NFSMNT_WANTAUTH 0x40000000 /* Wants an authenticator */ -#define NFSMNT_AUTHERR 0x80000000 /* Authentication error */ +#define NFSMNT_ACREGMIN 0x00040000 +#define NFSMNT_ACREGMAX 0x00080000 +#define NFSMNT_ACDIRMIN 0x00100000 +#define NFSMNT_ACDIRMAX 0x00200000 + +#define NFSSTA_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */ +#define NFSSTA_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */ +#define NFSSTA_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */ +#define NFSSTA_MNTD 0x00200000 /* Mnt server for mnt point */ +#define NFSSTA_DISMINPROG 0x00400000 /* Dismount in progress */ +#define NFSSTA_DISMNT 0x00800000 /* Dismounted */ +#define NFSSTA_SNDLOCK 0x01000000 /* Send socket lock */ +#define NFSSTA_WANTSND 0x02000000 /* Want above */ +#define NFSSTA_RCVLOCK 0x04000000 /* Rcv socket lock */ +#define NFSSTA_WANTRCV 0x08000000 /* Want above */ +#define NFSSTA_WAITAUTH 0x10000000 /* Wait for authentication */ +#define NFSSTA_HASAUTH 0x20000000 /* Has authenticator */ +#define NFSSTA_WANTAUTH 0x40000000 /* Wants an authenticator */ +#define NFSSTA_AUTHERR 0x80000000 /* Authentication error */ /* * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs @@ -580,8 +585,8 @@ int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *, int nfs_rephead __P((int, struct nfsrv_descript *, struct nfssvc_sock *, int, int, u_quad_t *, struct mbuf **, struct mbuf **, caddr_t *)); -int nfs_sndlock __P((int *, struct nfsreq *)); -void nfs_sndunlock __P((int *flagp)); +int nfs_sndlock __P((int *, int *, struct nfsreq *)); +void nfs_sndunlock __P((int *, int *)); int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *)); int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *, int)); diff --git a/sys/nfsclient/nfsmount.h b/sys/nfsclient/nfsmount.h index 63de0ad..2d502bd 100644 --- a/sys/nfsclient/nfsmount.h +++ b/sys/nfsclient/nfsmount.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsmount.h 8.3 (Berkeley) 3/30/95 - * $Id: nfsmount.h,v 1.12 1997/05/10 16:12:03 dfr Exp $ + * $Id: nfsmount.h,v 1.13 1997/08/16 19:16:05 wollman Exp $ */ @@ -48,6 +48,7 @@ */ struct nfsmount { int nm_flag; /* Flags for soft/hard... */ + int nm_state; /* Internal state flags */ struct mount *nm_mountp; /* Vfs structure for this filesystem */ int nm_numgrps; /* Max. size of groupslist */ u_char nm_fh[NFSX_V3FHMAX]; /* File handle of root dir */ @@ -70,6 +71,10 @@ struct nfsmount { int nm_readdirsize; /* Size of a readdir rpc */ int nm_readahead; /* Num. of blocks to readahead */ int nm_leaseterm; /* Term (sec) for NQNFS lease */ + int nm_acdirmin; /* Directory attr cache min lifetime */ + int nm_acdirmax; /* Directory attr cache max lifetime */ + int nm_acregmin; /* Reg file attr cache min lifetime */ + int nm_acregmax; /* Reg file attr cache max lifetime */ CIRCLEQ_HEAD(, nfsnode) nm_timerhead; /* Head of lease timer queue */ struct vnode *nm_inprog; /* Vnode in prog by nqnfs_clientd() */ uid_t nm_authuid; /* Uid for authenticator */ diff --git a/sys/nfsclient/nfsstats.h b/sys/nfsclient/nfsstats.h index 8b28c00..ad606ad 100644 --- a/sys/nfsclient/nfsstats.h +++ b/sys/nfsclient/nfsstats.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.4 (Berkeley) 5/1/95 - * $Id: nfs.h,v 1.33 1998/02/01 21:23:29 bde Exp $ + * $Id: nfs.h,v 1.34 1998/03/30 09:53:43 phk Exp $ */ #ifndef _NFS_NFS_H_ @@ -56,11 +56,17 @@ #define NFS_RETRANS 10 /* Num of retrans for soft mounts */ #define NFS_MAXGRPS 16 /* Max. size of groups list */ #ifndef NFS_MINATTRTIMO -#define NFS_MINATTRTIMO 5 /* Attribute cache timeout in sec */ +#define NFS_MINATTRTIMO 3 /* VREG attrib cache timeout in sec */ #endif #ifndef NFS_MAXATTRTIMO #define NFS_MAXATTRTIMO 60 #endif +#ifndef NFS_MINDIRATTRTIMO +#define NFS_MINDIRATTRTIMO 30 /* VDIR attrib cache timeout in sec */ +#endif +#ifndef NFS_MAXDIRATTRTIMO +#define NFS_MAXDIRATTRTIMO 60 +#endif #define NFS_WSIZE 8192 /* Def. write data size <= 8192 */ #define NFS_RSIZE 8192 /* Def. read data size <= 8192 */ #define NFS_READDIRSIZE 8192 /* Def. readdir size */ @@ -104,15 +110,6 @@ #endif /* - * Set the attribute timeout based on how recently the file has been modified. - */ -#define NFS_ATTRTIMEO(np) \ - ((((np)->n_flag & NMODIFIED) || \ - (time_second - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \ - ((time_second - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \ - (time_second - (np)->n_mtime) / 10)) - -/* * Expected allocation sizes for major data structures. If the actual size * of the structure exceeds these sizes, then malloc() will be allocating * almost twice the memory required. This is used in nfs_init() to warn @@ -149,6 +146,10 @@ struct nfs_args { int leaseterm; /* Term (sec) of lease */ int deadthresh; /* Retrans threshold */ char *hostname; /* server's name */ + int acregmin; /* cache attrs for reg files min time */ + int acregmax; /* cache attrs for reg files max time */ + int acdirmin; /* cache attrs for dirs min time */ + int acdirmax; /* cache attrs for dirs max time */ }; /* @@ -172,21 +173,25 @@ struct nfs_args { #define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */ #define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */ #define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */ -#define NFSMNT_INTERNAL 0xfffc0000 /* Bits set internally */ -#define NFSMNT_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */ -#define NFSMNT_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */ -#define NFSMNT_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */ -#define NFSMNT_MNTD 0x00200000 /* Mnt server for mnt point */ -#define NFSMNT_DISMINPROG 0x00400000 /* Dismount in progress */ -#define NFSMNT_DISMNT 0x00800000 /* Dismounted */ -#define NFSMNT_SNDLOCK 0x01000000 /* Send socket lock */ -#define NFSMNT_WANTSND 0x02000000 /* Want above */ -#define NFSMNT_RCVLOCK 0x04000000 /* Rcv socket lock */ -#define NFSMNT_WANTRCV 0x08000000 /* Want above */ -#define NFSMNT_WAITAUTH 0x10000000 /* Wait for authentication */ -#define NFSMNT_HASAUTH 0x20000000 /* Has authenticator */ -#define NFSMNT_WANTAUTH 0x40000000 /* Wants an authenticator */ -#define NFSMNT_AUTHERR 0x80000000 /* Authentication error */ +#define NFSMNT_ACREGMIN 0x00040000 +#define NFSMNT_ACREGMAX 0x00080000 +#define NFSMNT_ACDIRMIN 0x00100000 +#define NFSMNT_ACDIRMAX 0x00200000 + +#define NFSSTA_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */ +#define NFSSTA_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */ +#define NFSSTA_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */ +#define NFSSTA_MNTD 0x00200000 /* Mnt server for mnt point */ +#define NFSSTA_DISMINPROG 0x00400000 /* Dismount in progress */ +#define NFSSTA_DISMNT 0x00800000 /* Dismounted */ +#define NFSSTA_SNDLOCK 0x01000000 /* Send socket lock */ +#define NFSSTA_WANTSND 0x02000000 /* Want above */ +#define NFSSTA_RCVLOCK 0x04000000 /* Rcv socket lock */ +#define NFSSTA_WANTRCV 0x08000000 /* Want above */ +#define NFSSTA_WAITAUTH 0x10000000 /* Wait for authentication */ +#define NFSSTA_HASAUTH 0x20000000 /* Has authenticator */ +#define NFSSTA_WANTAUTH 0x40000000 /* Wants an authenticator */ +#define NFSSTA_AUTHERR 0x80000000 /* Authentication error */ /* * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs @@ -580,8 +585,8 @@ int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *, int nfs_rephead __P((int, struct nfsrv_descript *, struct nfssvc_sock *, int, int, u_quad_t *, struct mbuf **, struct mbuf **, caddr_t *)); -int nfs_sndlock __P((int *, struct nfsreq *)); -void nfs_sndunlock __P((int *flagp)); +int nfs_sndlock __P((int *, int *, struct nfsreq *)); +void nfs_sndunlock __P((int *, int *)); int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *)); int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *, int)); |