summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2010-05-18 05:18:21 +0000
committerrmacklem <rmacklem@FreeBSD.org>2010-05-18 05:18:21 +0000
commitfb4f09998080bd2fa70c75879bedb4dfef12a265 (patch)
tree7e4b10b8f0b8149dfabe9d85c5cb0ebeb033bf78
parent3e50c01a7f41c52f70d42234f5157b7aa3b4a1cf (diff)
downloadFreeBSD-src-fb4f09998080bd2fa70c75879bedb4dfef12a265.zip
FreeBSD-src-fb4f09998080bd2fa70c75879bedb4dfef12a265.tar.gz
Allow the experimental NFSv4 client to use cached attributes
when a write delegation is held. Also, add a missing mtx_unlock() call for the ACL debugging code. MFC after: 5 days
-rw-r--r--sys/fs/nfsclient/nfs_clsubs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clsubs.c b/sys/fs/nfsclient/nfs_clsubs.c
index 1553509..1443278 100644
--- a/sys/fs/nfsclient/nfs_clsubs.c
+++ b/sys/fs/nfsclient/nfs_clsubs.c
@@ -188,11 +188,12 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
struct nfsnode *np;
struct vattr *vap;
struct nfsmount *nmp;
- int timeo;
+ int timeo, mustflush;
np = VTONFS(vp);
vap = &np->n_vattr.na_vattr;
nmp = VFSTONFS(vp->v_mount);
+ mustflush = nfscl_mustflush(vp); /* must be before mtx_lock() */
#ifdef NFS_ACDEBUG
mtx_lock(&Giant); /* ncl_printf() */
#endif
@@ -228,9 +229,13 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
(time_second - np->n_attrstamp), timeo);
#endif
- if ((time_second - np->n_attrstamp) >= timeo) {
+ if ((time_second - np->n_attrstamp) >= timeo &&
+ mustflush != 0) {
newnfsstats.attrcache_misses++;
mtx_unlock(&np->n_mtx);
+#ifdef NFS_ACDEBUG
+ mtx_unlock(&Giant); /* ncl_printf() */
+#endif
return( ENOENT);
}
newnfsstats.attrcache_hits++;
OpenPOWER on IntegriCloud