mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
MFC: r208254
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.
This commit is contained in:
parent
4509665bd2
commit
5ea4f2ba9f
1 changed files with 7 additions and 2 deletions
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue