diff options
author | ps <ps@FreeBSD.org> | 2004-12-06 19:18:00 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2004-12-06 19:18:00 +0000 |
commit | 8eaa4f53e459fa71fae49ba6fbcc8ddcf23682b0 (patch) | |
tree | 4019db19520d82d9c16a47c76254153364dbc9eb /sys/nfsclient/nfs_subs.c | |
parent | b894547e6f605eea5875525ab3a9550c942206a6 (diff) | |
download | FreeBSD-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/nfsclient/nfs_subs.c')
-rw-r--r-- | sys/nfsclient/nfs_subs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index b91adae..8668a99 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -534,7 +534,7 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, vp->v_type = vtyp; if (vp->v_type == VFIFO) vp->v_op = &nfs_fifoops; - np->n_mtime = mtime.tv_sec; + np->n_mtime = mtime; } vap = &np->n_vattr; vap->va_type = vtyp; @@ -639,7 +639,7 @@ nfs_getattrcache(struct vnode *vp, struct vattr *vaper) vap = &np->n_vattr; nmp = VFSTONFS(vp->v_mount); /* XXX n_mtime doesn't seem to be updated on a miss-and-reload */ - timeo = (time_second - np->n_mtime) / 10; + timeo = (time_second - np->n_mtime.tv_sec) / 10; #ifdef NFS_ACDEBUG if (nfs_acdebug>1) @@ -941,8 +941,8 @@ nfsm_wcc_data_xx(struct vnode **v, int *f, struct mbuf **md, caddr_t *dpos) if (tl == NULL) return EBADRPC; if (*f) - ttretf = (VTONFS(*v)->n_mtime == - fxdr_unsigned(u_int32_t, *(tl + 2))); + ttretf = (VTONFS(*v)->n_mtime.tv_sec == fxdr_unsigned(u_int32_t, *(tl + 2)) && + VTONFS(*v)->n_mtime.tv_nsec == fxdr_unsigned(u_int32_t, *(tl + 3))); } t1 = nfsm_postop_attr_xx(v, &ttattrf, md, dpos); if (t1) |