- Lock accesses to v_usecount.

- Convert interlock locks to use standard macros.
This commit is contained in:
Jeff Roberson 2002-09-25 02:45:50 +00:00
parent 8823f1b6db
commit d4820f8036
2 changed files with 11 additions and 7 deletions

View File

@ -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);

View File

@ -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));
}