diff options
author | jeff <jeff@FreeBSD.org> | 2002-09-25 02:45:50 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-09-25 02:45:50 +0000 |
commit | 41b9d1ca5dee24b3a1e1d3bb37393b143389de73 (patch) | |
tree | 8bfdbb5b73f82094d365374315c348adf0d1df8f /sys/ufs | |
parent | 263f8202f6610e839d8fc82b483baf7b85d8de91 (diff) | |
download | FreeBSD-src-41b9d1ca5dee24b3a1e1d3bb37393b143389de73.zip FreeBSD-src-41b9d1ca5dee24b3a1e1d3bb37393b143389de73.tar.gz |
- Lock accesses to v_usecount.
- Convert interlock locks to use standard macros.
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_inode.c | 4 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c index d32709e..24faeb3 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 5ec4b6e..6536a70 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)); } |