diff options
| author | Jeff Roberson <jeff@FreeBSD.org> | 2005-03-24 06:08:58 +0000 |
|---|---|---|
| committer | Jeff Roberson <jeff@FreeBSD.org> | 2005-03-24 06:08:58 +0000 |
| commit | c167961e27e3e41e1d53ed76a9a6720510cf4e77 (patch) | |
| tree | 2df5784df43150e6fcbe16525ec1f58a050bb8d0 /sys/kern/vfs_subr.c | |
| parent | 3e6bcad3753ac40c30c4e022cca62e557bd2c3a2 (diff) | |
Notes
Diffstat (limited to 'sys/kern/vfs_subr.c')
| -rw-r--r-- | sys/kern/vfs_subr.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 18ca28f20bc0..9668b58b7468 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1927,7 +1927,11 @@ vput(vp) if (vp->v_usecount == 1) { v_incr_usecount(vp, -1); - vinactive(vp, td); + if (VOP_ISLOCKED(vp, td) != LK_EXCLUSIVE && + VOP_LOCK(vp, LK_EXCLUPGRADE, td) != 0) + vp->v_iflag |= VI_OWEINACT; + else + vinactive(vp, td); VOP_UNLOCK(vp, 0, td); if (VSHOULDFREE(vp)) vfree(vp); @@ -2003,7 +2007,7 @@ vinactive(struct vnode *vp, struct thread *td) VI_LOCK(vp); VNASSERT(vp->v_iflag & VI_DOINGINACT, vp, ("vinactive: lost VI_DOINGINACT")); - vp->v_iflag &= ~VI_DOINGINACT; + vp->v_iflag &= ~(VI_DOINGINACT|VI_OWEINACT); } /* @@ -2250,6 +2254,11 @@ vgonel(struct vnode *vp, struct thread *td) if ((vp->v_iflag & VI_DOINGINACT) == 0) vinactive(vp, td); VI_UNLOCK(vp); + } else { + VI_LOCK(vp); + if (vp->v_iflag & VI_OWEINACT) + vinactive(vp, td); + VI_UNLOCK(vp); } /* * Reclaim the vnode. @@ -2742,7 +2751,7 @@ vbusy(struct vnode *vp) freevnodes--; mtx_unlock(&vnode_free_list_mtx); - vp->v_iflag &= ~(VI_FREE|VI_AGE); + vp->v_iflag &= ~(VI_FREE|VI_AGE|VI_OWEINACT); } /* |
