diff options
author | jhb <jhb@FreeBSD.org> | 2001-06-28 04:10:07 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-06-28 04:10:07 +0000 |
commit | ab91beada7d88e4a56b4217fee5826cb97b5cef7 (patch) | |
tree | 3520caa3d566aad1d0e33edb86f240a96f040425 /sys/nfs/nfs_common.c | |
parent | f7198d2b3a1299ad745cab94d5192d42710bb046 (diff) | |
download | FreeBSD-src-ab91beada7d88e4a56b4217fee5826cb97b5cef7.zip FreeBSD-src-ab91beada7d88e4a56b4217fee5826cb97b5cef7.tar.gz |
- Protect the mnt_vnode list with the mntvnode lock.
- Use queue(9) macros.
Diffstat (limited to 'sys/nfs/nfs_common.c')
-rw-r--r-- | sys/nfs/nfs_common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c index 18cb8a9..b9c4197 100644 --- a/sys/nfs/nfs_common.c +++ b/sys/nfs/nfs_common.c @@ -2141,11 +2141,12 @@ nfs_clearcommit(mp) s = splbio(); mtx_assert(&Giant, MA_OWNED); mtx_assert(&vm_mtx, MA_NOTOWNED); + mtx_lock(&mntvnode_mtx); loop: - for (vp = mp->mnt_vnodelist.lh_first; vp; vp = nvp) { + for (vp = LIST_FIRST(&mp->mnt_vnodelist); vp; vp = nvp) { if (vp->v_mount != mp) /* Paranoia */ goto loop; - nvp = vp->v_mntvnodes.le_next; + nvp = LIST_NEXT(vp, v_mntvnodes); for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { nbp = TAILQ_NEXT(bp, b_vnbufs); if (BUF_REFCNT(bp) == 0 && @@ -2154,6 +2155,7 @@ loop: bp->b_flags &= ~(B_NEEDCOMMIT | B_CLUSTEROK); } } + mtx_unlock(&mntvnode_mtx); splx(s); } |