From 1b367556b5834cc5add330d4dc19340089c86939 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Wed, 24 Jan 2001 12:35:55 +0000 Subject: Convert all simplelocks to mutexes and remove the simplelock implementations. --- sys/gnu/fs/ext2fs/ext2_vfsops.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'sys/gnu/fs/ext2fs') diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index 12682e4e476f..e7dfbf26ed9c 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c @@ -56,8 +56,7 @@ #include #include #include - -#include +#include #include #include @@ -575,23 +574,23 @@ ext2_reload(mountp, cred, p) brelse(bp); loop: - simple_lock(&mntvnode_slock); + mtx_enter(&mntvnode_mtx, MTX_DEF); for (vp = mountp->mnt_vnodelist.lh_first; vp != NULL; vp = nvp) { if (vp->v_mount != mountp) { - simple_unlock(&mntvnode_slock); + mtx_exit(&mntvnode_mtx, MTX_DEF); goto loop; } nvp = vp->v_mntvnodes.le_next; /* * Step 4: invalidate all inactive vnodes. */ - if (vrecycle(vp, &mntvnode_slock, p)) + if (vrecycle(vp, &mntvnode_mtx, p)) goto loop; /* * Step 5: invalidate all cached file data. */ mtx_enter(&vp->v_interlock, MTX_DEF); - simple_unlock(&mntvnode_slock); + mtx_exit(&mntvnode_mtx, MTX_DEF); if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) { goto loop; } @@ -613,9 +612,9 @@ loop: &ip->i_din); brelse(bp); vput(vp); - simple_lock(&mntvnode_slock); + mtx_enter(&mntvnode_mtx, MTX_DEF); } - simple_unlock(&mntvnode_slock); + mtx_exit(&mntvnode_mtx, MTX_DEF); return (0); } @@ -940,7 +939,7 @@ ext2_sync(mp, waitfor, cred, p) /* * Write back each (modified) inode. */ - simple_lock(&mntvnode_slock); + mtx_enter(&mntvnode_mtx, MTX_DEF); loop: for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nvp) { /* @@ -959,10 +958,10 @@ loop: mtx_exit(&vp->v_interlock, MTX_DEF); continue; } - simple_unlock(&mntvnode_slock); + mtx_exit(&mntvnode_mtx, MTX_DEF); error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p); if (error) { - simple_lock(&mntvnode_slock); + mtx_enter(&mntvnode_mtx, MTX_DEF); if (error == ENOENT) goto loop; continue; @@ -971,9 +970,9 @@ loop: allerror = error; VOP_UNLOCK(vp, 0, p); vrele(vp); - simple_lock(&mntvnode_slock); + mtx_enter(&mntvnode_mtx, MTX_DEF); } - simple_unlock(&mntvnode_slock); + mtx_exit(&mntvnode_mtx, MTX_DEF); /* * Force stale file system control information to be flushed. */ -- cgit v1.2.3