? o Index: nfs.h =================================================================== RCS file: /cvsroot/src/sys/nfs/nfs.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- nfs.h 26 Oct 2004 00:58:54 -0000 1.48 +++ nfs.h 18 Sep 2005 23:44:54 -0000 1.49 @@ -1,4 +1,4 @@ -/* $NetBSD: nfs.h,v 1.48 2004/10/26 00:58:54 yamt Exp $ */ +/* $NetBSD: nfs.h,v 1.49 2005/09/18 23:44:54 christos Exp $ */ /* * Copyright (c) 1989, 1993, 1995 * The Regents of the University of California. All rights reserved. @@ -157,11 +157,12 @@ /* * Set the attribute timeout based on how recently the file has been modified. */ -#define NFS_ATTRTIMEO(np) \ +#define NFS_ATTRTIMEO(nmp, np) \ + ((nmp->nm_flag & NFSMNT_NOAC) ? 0 : \ ((((np)->n_flag & NMODIFIED) || \ (time.tv_sec - (np)->n_mtime.tv_sec) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \ ((time.tv_sec - (np)->n_mtime.tv_sec) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \ - (time.tv_sec - (np)->n_mtime.tv_sec) / 10)) + (time.tv_sec - (np)->n_mtime.tv_sec) / 10))) /* * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs Index: nfs_subs.c =================================================================== RCS file: /cvsroot/src/sys/nfs/nfs_subs.c,v retrieving revision 1.151 retrieving revision 1.152 diff -u -r1.151 -r1.152 --- nfs_subs.c 19 Aug 2005 12:47:23 -0000 1.151 +++ nfs_subs.c 19 Sep 2005 00:53:55 -0000 1.152 @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_subs.c,v 1.151 2005/08/19 12:47:23 yamt Exp $ */ +/* $NetBSD: nfs_subs.c,v 1.152 2005/09/19 00:53:55 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.151 2005/08/19 12:47:23 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.152 2005/09/19 00:53:55 christos Exp $"); #include "fs_nfs.h" #include "opt_nfs.h" @@ -1863,10 +1863,11 @@ struct vattr *vaper; { struct nfsnode *np = VTONFS(vp); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct vattr *vap; if (np->n_attrstamp == 0 || - (mono_time.tv_sec - np->n_attrstamp) >= NFS_ATTRTIMEO(np)) { + (mono_time.tv_sec - np->n_attrstamp) >= NFS_ATTRTIMEO(nmp, np)) { nfsstats.attrcache_misses++; return (ENOENT); } Index: nfs_vfsops.c =================================================================== RCS file: /cvsroot/src/sys/nfs/nfs_vfsops.c,v retrieving revision 1.148 retrieving revision 1.149 diff -u -r1.148 -r1.149 --- nfs_vfsops.c 9 Jun 2005 02:19:59 -0000 1.148 +++ nfs_vfsops.c 19 Sep 2005 00:49:52 -0000 1.149 @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_vfsops.c,v 1.148 2005/06/09 02:19:59 atatat Exp $ */ +/* $NetBSD: nfs_vfsops.c,v 1.149 2005/09/19 00:49:52 christos Exp $ */ /* * Copyright (c) 1989, 1993, 1995 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.148 2005/06/09 02:19:59 atatat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.149 2005/09/19 00:49:52 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -318,7 +318,7 @@ * XXX time must be non-zero when we init the interface or else * the arp code will wedge. [Fixed now in if_ether.c] * However, the NFS attribute cache gives false "hits" when - * time.tv_sec < NFS_ATTRTIMEO(np) so keep this in for now. + * time.tv_sec < NFS_ATTRTIMEO(nmp, np) so keep this in for now. */ if (time.tv_sec < NFS_MAXATTRTIMO) time.tv_sec = NFS_MAXATTRTIMO; Index: nfs_vnops.c =================================================================== RCS file: /cvsroot/src/sys/nfs/nfs_vnops.c,v retrieving revision 1.226 retrieving revision 1.227 diff -u -r1.226 -r1.227 --- nfs_vnops.c 19 Aug 2005 10:08:48 -0000 1.226 +++ nfs_vnops.c 19 Sep 2005 00:49:52 -0000 1.227 @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_vnops.c,v 1.226 2005/08/19 10:08:48 yamt Exp $ */ +/* $NetBSD: nfs_vnops.c,v 1.227 2005/09/19 00:49:52 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.226 2005/08/19 10:08:48 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.227 2005/09/19 00:49:52 christos Exp $"); #include "opt_inet.h" #include "opt_nfs.h" @@ -338,9 +338,10 @@ #endif int cachevalid; struct nfsnode *np = VTONFS(vp); + struct nfsmount *nmp = VFSTONFS(vp->v_mount); cachevalid = (np->n_accstamp != -1 && - (mono_time.tv_sec - np->n_accstamp) < NFS_ATTRTIMEO(np) && + (mono_time.tv_sec - np->n_accstamp) < NFS_ATTRTIMEO(nmp, np) && np->n_accuid == ap->a_cred->cr_uid); /* Index: nfsmount.h =================================================================== RCS file: /cvsroot/src/sys/nfs/nfsmount.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- nfsmount.h 19 Jan 2005 16:22:19 -0000 1.33 +++ nfsmount.h 18 Sep 2005 23:44:54 -0000 1.34 @@ -1,4 +1,4 @@ -/* $NetBSD: nfsmount.h,v 1.33 2005/01/19 16:22:19 yamt Exp $ */ +/* $NetBSD: nfsmount.h,v 1.34 2005/09/18 23:44:54 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -85,13 +85,14 @@ #define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */ #define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */ #define NFSMNT_XLATECOOKIE 0x00040000 /* 32<->64 dir cookie xlation */ +#define NFSMNT_NOAC 0x00080000 /* Turn off attribute cache */ #define NFSMNT_BITS "\177\20" \ "b\00soft\0b\01wsize\0b\02rsize\0b\03timeo\0" \ "b\04retrans\0b\05maxgrps\0b\06intr\0b\07noconn\0" \ "b\10nqnfs\0b\11nfsv3\0b\12kerb\0b\13dumbtimr\0" \ "b\14leaseterm\0b\15readahead\0b\16deadthresh\0b\17resvport\0" \ - "b\20rdirplus\0b\21readdirsize\0b\22xlatecookie\0" + "b\20rdirplus\0b\21readdirsize\0b\22xlatecookie\0b\23noac\0" /* * NFS internal flags (nm_iflag) */