diff options
| author | 2009-01-19 23:40:36 +0000 | |
|---|---|---|
| committer | 2009-01-19 23:40:36 +0000 | |
| commit | fdc7e2e58d1bb00cdcc1be13de80732ae071c84a (patch) | |
| tree | d03567a47e547f1d571441d09c37e6dee4003ce0 /sys/nfs/nfs_bio.c | |
| parent | updates for BKK and DMK; based on a diff from Robert Elz, submitted (diff) | |
| download | wireguard-openbsd-fdc7e2e58d1bb00cdcc1be13de80732ae071c84a.tar.xz wireguard-openbsd-fdc7e2e58d1bb00cdcc1be13de80732ae071c84a.zip | |
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.c | 12 |
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); |
