diff options
author | Alexander Kabaev <kan@FreeBSD.org> | 2003-11-05 04:30:08 +0000 |
---|---|---|
committer | Alexander Kabaev <kan@FreeBSD.org> | 2003-11-05 04:30:08 +0000 |
commit | ca430f2e92d073fc5c05df06b6b72cfb2842ee4b (patch) | |
tree | d6d549e791dd7c4a627af5beb25ec44a2fcdd02d /sys/gnu/fs/ext2fs | |
parent | 5c8bb90bf7268afbc9e28ccac23cae1fdaf73a4c (diff) | |
download | src-ca430f2e92d073fc5c05df06b6b72cfb2842ee4b.tar.gz src-ca430f2e92d073fc5c05df06b6b72cfb2842ee4b.zip |
Remove mntvnode_mtx and replace it with per-mountpoint mutex.
Introduce two new macros MNT_ILOCK(mp)/MNT_IUNLOCK(mp) to
operate on this mutex transparently.
Eventually new mutex will be protecting more fields in
struct mount, not only vnode list.
Discussed with: jeff
Notes
Notes:
svn path=/head/; revision=122091
Diffstat (limited to 'sys/gnu/fs/ext2fs')
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_vfsops.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index 86559b845473..39a4dede1f6c 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c @@ -569,10 +569,10 @@ ext2_reload(mountp, cred, td) brelse(bp); loop: - mtx_lock(&mntvnode_mtx); + MNT_ILOCK(mp); for (vp = TAILQ_FIRST(&mountp->mnt_nvnodelist); vp != NULL; vp = nvp) { if (vp->v_mount != mountp) { - mtx_unlock(&mntvnode_mtx); + MNT_IUNLOCK(mp); goto loop; } nvp = TAILQ_NEXT(vp, v_nmntvnodes); @@ -581,7 +581,7 @@ loop: VI_UNLOCK(vp); continue; } - mtx_unlock(&mntvnode_mtx); + MNT_IUNLOCK(mp); /* * Step 4: invalidate all inactive vnodes. */ @@ -614,9 +614,9 @@ loop: brelse(bp); VOP_UNLOCK(vp, 0, td); vrele(vp); - mtx_lock(&mntvnode_mtx); + MNT_ILOCK(mp); } - mtx_unlock(&mntvnode_mtx); + MNT_IUNLOCK(mp); return (0); } @@ -901,7 +901,7 @@ ext2_sync(mp, waitfor, cred, td) /* * Write back each (modified) inode. */ - mtx_lock(&mntvnode_mtx); + MNT_ILOCK(mp); loop: for (vp = TAILQ_FIRST(&mp->mnt_nvnodelist); vp != NULL; vp = nvp) { /* @@ -916,19 +916,19 @@ loop: VI_UNLOCK(vp); continue; } - mtx_unlock(&mntvnode_mtx); + MNT_IUNLOCK(mp); 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) || waitfor == MNT_LAZY))) { VI_UNLOCK(vp); - mtx_lock(&mntvnode_mtx); + MNT_ILOCK(mp); continue; } error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, td); if (error) { - mtx_lock(&mntvnode_mtx); + MNT_ILOCK(mp); if (error == ENOENT) goto loop; continue; @@ -937,9 +937,9 @@ loop: allerror = error; VOP_UNLOCK(vp, 0, td); vrele(vp); - mtx_lock(&mntvnode_mtx); + MNT_ILOCK(mp); } - mtx_unlock(&mntvnode_mtx); + MNT_IUNLOCK(mp); /* * Force stale file system control information to be flushed. */ |