diff --git a/sys/kern/vfs_lock.c b/sys/kern/vfs_lock.c index 2de5690..e770bf0 100644 --- a/sys/kern/vfs_lock.c +++ b/sys/kern/vfs_lock.c @@ -355,6 +355,12 @@ vhold(struct vnode *vp) atomic_add_int(&vp->v_auxrefs, 1); } +void +vforcefin(struct vnode *vp) +{ + atomic_set_int(&vp->v_refcnt, VREF_FINALIZE); +} + /* * Remove an auxiliary reference from the vnode. */ diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 3067571..a12c9e7 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -556,6 +556,7 @@ void vx_put (struct vnode *vp); int vget (struct vnode *vp, int lockflag); void vput (struct vnode *vp); void vhold (struct vnode *); +void vforcefin(struct vnode *); void vdrop (struct vnode *); void vref (struct vnode *vp); void vrele (struct vnode *vp); diff --git a/sys/vfs/dirfs/dirfs_vnops.c b/sys/vfs/dirfs/dirfs_vnops.c index 2e0a92d..a79468e 100644 --- a/sys/vfs/dirfs/dirfs_vnops.c +++ b/sys/vfs/dirfs/dirfs_vnops.c @@ -345,11 +345,10 @@ dirfs_close(struct vop_close_args *ap) vop_stdclose(ap); /* - * XXX - Currently VOP_INACTIVE() is not being called unless there is - * vnode pressure so, by now, call inactive directly on last close. + * Force VOP_INACTIVE() on last close. */ if (vp->v_opencount == 0 && vp->v_writecount == 0) - VOP_INACTIVE(vp); + vforcefin(vp); KTR_LOG(dirfs_close, dnp, dnp->dn_fd, vp->v_opencount, vp->v_writecount, error);