summaryrefslogtreecommitdiffstats
path: root/sys/nfs4client
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2004-12-06 19:18:00 +0000
committerps <ps@FreeBSD.org>2004-12-06 19:18:00 +0000
commit8eaa4f53e459fa71fae49ba6fbcc8ddcf23682b0 (patch)
tree4019db19520d82d9c16a47c76254153364dbc9eb /sys/nfs4client
parentb894547e6f605eea5875525ab3a9550c942206a6 (diff)
downloadFreeBSD-src-8eaa4f53e459fa71fae49ba6fbcc8ddcf23682b0.zip
FreeBSD-src-8eaa4f53e459fa71fae49ba6fbcc8ddcf23682b0.tar.gz
2 fixes that improve on the consistency of the NFS client cache.
- Change the cached mtime to a 'struct timespec' from a time_t. Improving the precision of the cached mtime tightens up NFS' "close-to-open" consistency considerably. - Always force an over-the-wire consistency check from nfs_open() (unless the file is marked modified). This further improves NFS' "close-to-open" consistency. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Diffstat (limited to 'sys/nfs4client')
-rw-r--r--sys/nfs4client/nfs4_vn_subs.c4
-rw-r--r--sys/nfs4client/nfs4_vnops.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/nfs4client/nfs4_vn_subs.c b/sys/nfs4client/nfs4_vn_subs.c
index cded7f5..dd6617b 100644
--- a/sys/nfs4client/nfs4_vn_subs.c
+++ b/sys/nfs4client/nfs4_vn_subs.c
@@ -98,10 +98,10 @@ nfs4_vnop_loadattrcache(struct vnode *vp, struct nfsv4_fattr *fap,
*/
np = VTONFS(vp);
vap = &np->n_vattr;
- if (vp->v_type != vtyp || np->n_mtime == 0) {
+ if (vp->v_type != vtyp || np->n_mtime.tv_sec == 0) {
bzero(vap, sizeof *vap);
vp->v_type = vtyp;
- np->n_mtime = mtime.tv_sec;
+ np->n_mtime.tv_sec = mtime.tv_sec;
}
vap->va_type = vtyp;
vap->va_mode = (vmode & 07777);
diff --git a/sys/nfs4client/nfs4_vnops.c b/sys/nfs4client/nfs4_vnops.c
index 707b075..5b9b582 100644
--- a/sys/nfs4client/nfs4_vnops.c
+++ b/sys/nfs4client/nfs4_vnops.c
@@ -1412,7 +1412,7 @@ nfs4_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
/* XXX wccflag */
if (wccflag)
- VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.tv_sec;
+ VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime;
error = nfs_v4postop(&cp, error);
@@ -1994,7 +1994,7 @@ nfs4_readdir(struct vop_readdir_args *ap)
if (np->n_direofoffset > 0 && uio->uio_offset >= np->n_direofoffset &&
(np->n_flag & NMODIFIED) == 0) {
if (VOP_GETATTR(vp, &vattr, ap->a_cred, uio->uio_td) == 0 &&
- np->n_mtime == vattr.va_mtime.tv_sec) {
+ np->n_mtime.tv_sec == vattr.va_mtime.tv_sec) {
nfsstats.direofcache_hits++;
return (0);
}
OpenPOWER on IntegriCloud