aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/ufs/ufs/ufs_inode.c4
-rw-r--r--sys/ufs/ufs/ufs_vnops.c14
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c
index d32709e5ef45..24faeb3e3c9b 100644
--- a/sys/ufs/ufs/ufs_inode.c
+++ b/sys/ufs/ufs/ufs_inode.c
@@ -76,8 +76,10 @@ ufs_inactive(ap)
mode_t mode;
int error = 0;
+ VI_LOCK(vp);
if (prtactive && vp->v_usecount != 0)
vprint("ufs_inactive: pushing active", vp);
+ VI_UNLOCK(vp);
/*
* Ignore inodes related to stale file handles.
@@ -149,8 +151,10 @@ ufs_reclaim(ap)
int i;
#endif
+ VI_LOCK(vp);
if (prtactive && vp->v_usecount != 0)
vprint("ufs_reclaim: pushing active", vp);
+ VI_UNLOCK(vp);
if (ip->i_flag & IN_LAZYMOD) {
ip->i_flag |= IN_MODIFIED;
UFS_UPDATE(vp, 0);
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 5ec4b6e6e89b..6536a703a71d 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -296,12 +296,12 @@ ufs_close(ap)
struct vnode *vp = ap->a_vp;
struct mount *mp;
- mtx_lock(&vp->v_interlock);
+ VI_LOCK(vp);
if (vp->v_usecount > 1) {
ufs_itimes(vp);
- mtx_unlock(&vp->v_interlock);
+ VI_UNLOCK(vp);
} else {
- mtx_unlock(&vp->v_interlock);
+ VI_UNLOCK(vp);
/*
* If we are closing the last reference to an unlinked
* file, then it will be freed by the inactive routine.
@@ -2050,10 +2050,10 @@ ufsspec_close(ap)
{
struct vnode *vp = ap->a_vp;
- mtx_lock(&vp->v_interlock);
+ VI_LOCK(vp);
if (vp->v_usecount > 1)
ufs_itimes(vp);
- mtx_unlock(&vp->v_interlock);
+ VI_UNLOCK(vp);
return (VOCALL(spec_vnodeop_p, VOFFSET(vop_close), ap));
}
@@ -2124,10 +2124,10 @@ ufsfifo_close(ap)
{
struct vnode *vp = ap->a_vp;
- mtx_lock(&vp->v_interlock);
+ VI_LOCK(vp);
if (vp->v_usecount > 1)
ufs_itimes(vp);
- mtx_unlock(&vp->v_interlock);
+ VI_UNLOCK(vp);
return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_close), ap));
}