diff options
author | mckusick <mckusick@FreeBSD.org> | 2012-04-17 16:28:22 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2012-04-17 16:28:22 +0000 |
commit | ffee40eeff5500634fb5111e387f11dee781d197 (patch) | |
tree | 0e74691cb191897ed22ab84b20109f1b4147b16d /sys/ufs/ffs/ffs_softdep.c | |
parent | 7f09aee7a12feb487299902e6c6ec4c3ae44cdf3 (diff) | |
download | FreeBSD-src-ffee40eeff5500634fb5111e387f11dee781d197.zip FreeBSD-src-ffee40eeff5500634fb5111e387f11dee781d197.tar.gz |
Replace the MNT_VNODE_FOREACH interface with MNT_VNODE_FOREACH_ALL.
The primary changes are that the user of the interface no longer
needs to manage the mount-mutex locking and that the vnode that
is returned has its mutex locked (thus avoiding the need to check
to see if its is DOOMED or other possible end of life senarios).
To minimize compatibility issues for third-party developers, the
old MNT_VNODE_FOREACH interface will remain available so that this
change can be MFC'ed to 9. Following the MFC to 9, MNT_VNODE_FOREACH
will be removed in head.
The reason for this update is to prepare for the addition of the
MNT_VNODE_FOREACH_ACTIVE interface that will loop over just the
active vnodes associated with a mount point (typically less than
1% of the vnodes associated with the mount point).
Reviewed by: kib
Tested by: Peter Holm
MFC after: 2 weeks
Diffstat (limited to 'sys/ufs/ffs/ffs_softdep.c')
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index a435738..dcf9622 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -12642,29 +12642,21 @@ retry: fs->fs_cstotal.cs_nbfree <= needed) || (resource == FLUSH_INODES_WAIT && fs->fs_pendinginodes > 0 && fs->fs_cstotal.cs_nifree <= needed)) { - MNT_ILOCK(mp); - MNT_VNODE_FOREACH(lvp, mp, mvp) { - VI_LOCK(lvp); + MNT_VNODE_FOREACH_ALL(lvp, mp, mvp) { if (TAILQ_FIRST(&lvp->v_bufobj.bo_dirty.bv_hd) == 0) { VI_UNLOCK(lvp); continue; } - MNT_IUNLOCK(mp); if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT, - curthread)) { - MNT_ILOCK(mp); + curthread)) continue; - } if (lvp->v_vflag & VV_NOSYNC) { /* unlinked */ vput(lvp); - MNT_ILOCK(mp); continue; } (void) ffs_syncvnode(lvp, MNT_NOWAIT, 0); vput(lvp); - MNT_ILOCK(mp); } - MNT_IUNLOCK(mp); lvp = ump->um_devvp; if (vn_lock(lvp, LK_EXCLUSIVE | LK_NOWAIT) == 0) { VOP_FSYNC(lvp, MNT_NOWAIT, curthread); |