diff options
author | jasone <jasone@FreeBSD.org> | 2000-10-04 01:29:17 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2000-10-04 01:29:17 +0000 |
commit | 4e290e67b7310d906f113850fddfdf1017a9d15b (patch) | |
tree | bae3e99c848c6e38aee34a7cf61ffa9ca55b0095 /sys/ufs/ffs | |
parent | bea51a4aa1bf67a183bd1d4a6227fa891345af60 (diff) | |
download | FreeBSD-src-4e290e67b7310d906f113850fddfdf1017a9d15b.zip FreeBSD-src-4e290e67b7310d906f113850fddfdf1017a9d15b.tar.gz |
Convert lockmgr locks from using simple locks to using mutexes.
Add lockdestroy() and appropriate invocations, which corresponds to
lockinit() and must be called to clean up after a lockmgr lock is no
longer needed.
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 6806734..ea6ef69 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -51,6 +51,8 @@ #include <sys/disklabel.h> #include <sys/malloc.h> +#include <machine/mutex.h> + #include <ufs/ufs/extattr.h> #include <ufs/ufs/quota.h> #include <ufs/ufs/ufsmount.h> @@ -394,7 +396,7 @@ ffs_reload(mp, cred, p) if (devvp->v_tag != VT_MFS && vn_isdisk(devvp, NULL)) { vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); vfs_object_create(devvp, p, p->p_ucred); - simple_lock(&devvp->v_interlock); + mtx_enter(&devvp->v_interlock, MTX_DEF); VOP_UNLOCK(devvp, LK_INTERLOCK, p); } @@ -469,7 +471,7 @@ loop: /* * Step 5: invalidate all cached file data. */ - simple_lock(&vp->v_interlock); + mtx_enter(&vp->v_interlock, MTX_DEF); simple_unlock(&mntvnode_slock); if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) { goto loop; @@ -551,7 +553,7 @@ ffs_mountfs(devvp, mp, p, malloctype) if (devvp->v_tag != VT_MFS && vn_isdisk(devvp, NULL)) { vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); vfs_object_create(devvp, p, cred); - simple_lock(&devvp->v_interlock); + mtx_enter(&devvp->v_interlock, MTX_DEF); VOP_UNLOCK(devvp, LK_INTERLOCK, p); } @@ -933,13 +935,13 @@ loop: */ if (vp->v_mount != mp) goto loop; - simple_lock(&vp->v_interlock); + mtx_enter(&vp->v_interlock, MTX_DEF); nvp = vp->v_mntvnodes.le_next; ip = VTOI(vp); if (vp->v_type == VNON || ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 && TAILQ_EMPTY(&vp->v_dirtyblkhd))) { - simple_unlock(&vp->v_interlock); + mtx_exit(&vp->v_interlock, MTX_DEF); continue; } if (vp->v_type != VCHR) { @@ -957,7 +959,7 @@ loop: simple_lock(&mntvnode_slock); } else { simple_unlock(&mntvnode_slock); - simple_unlock(&vp->v_interlock); + mtx_exit(&vp->v_interlock, MTX_DEF); UFS_UPDATE(vp, wait); simple_lock(&mntvnode_slock); } |