summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_bio.c
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2009-01-19 23:40:37 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2009-01-19 23:40:37 +0000
commit931bd9afdef68553b8a16d6a6a988f9c047722a0 (patch)
treec95558d5cc4920f74900179fe49b73a35e771709 /sys/nfs/nfs_bio.c
parent7bc6d5eec6c35ecc0b4185072334ffd6acd4ccc8 (diff)
Introduce a macro to invalidate the attribute
cache instead of setting n_attrstamp to 0 directly. Lift the macro name from NetBSD. prompted by and OK blambert@
Diffstat (limited to 'sys/nfs/nfs_bio.c')
-rw-r--r--sys/nfs/nfs_bio.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 18c7690e422..cd50fbcd023 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.55 2008/08/09 10:14:02 thib Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.56 2009/01/19 23:40:36 thib Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
@@ -106,13 +106,9 @@ nfs_bioread(vp, uio, ioflag, cred)
* server, so flush all of the file's data out of the cache.
* Then force a getattr rpc to ensure that you have up to date
* attributes.
- * NB: This implies that cache data can be read when up to
- * NFS_ATTRTIMEO seconds out of date. If you find that you need current
- * attributes this could be forced by setting n_attrstamp to 0 before
- * the VOP_GETATTR() call.
*/
if (np->n_flag & NMODIFIED) {
- np->n_attrstamp = 0;
+ NFS_INVALIDATE_ATTRCACHE(np);
error = VOP_GETATTR(vp, &vattr, cred, p);
if (error)
return (error);
@@ -305,13 +301,13 @@ nfs_write(v)
(void)nfs_fsinfo(nmp, vp, cred, p);
if (ioflag & (IO_APPEND | IO_SYNC)) {
if (np->n_flag & NMODIFIED) {
- np->n_attrstamp = 0;
+ NFS_INVALIDATE_ATTRCACHE(np);
error = nfs_vinvalbuf(vp, V_SAVE, cred, p);
if (error)
return (error);
}
if (ioflag & IO_APPEND) {
- np->n_attrstamp = 0;
+ NFS_INVALIDATE_ATTRCACHE(np);
error = VOP_GETATTR(vp, &vattr, cred, p);
if (error)
return (error);