Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/nfs Allow turning off the attribute cache.



details:   https://anonhg.NetBSD.org/src/rev/e50bc2f73bc8
branches:  trunk
changeset: 584461:e50bc2f73bc8
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Sep 18 23:44:54 2005 +0000

description:
Allow turning off the attribute cache.

diffstat:

 sys/nfs/nfs.h      |  7 ++++---
 sys/nfs/nfsmount.h |  5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r a41c49d1b763 -r e50bc2f73bc8 sys/nfs/nfs.h
--- a/sys/nfs/nfs.h     Sun Sep 18 21:50:20 2005 +0000
+++ b/sys/nfs/nfs.h     Sun Sep 18 23:44:54 2005 +0000
@@ -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
diff -r a41c49d1b763 -r e50bc2f73bc8 sys/nfs/nfsmount.h
--- a/sys/nfs/nfsmount.h        Sun Sep 18 21:50:20 2005 +0000
+++ b/sys/nfs/nfsmount.h        Sun Sep 18 23:44:54 2005 +0000
@@ -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) */



Home | Main Index | Thread Index | Old Index