From 02517b6731ab2da44ce9b49260429744cf0114d5 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 4 Aug 2002 10:29:36 +0000 Subject: - Replace v_flag with v_iflag and v_vflag - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS --- sys/fs/hpfs/hpfs_vnops.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/fs/hpfs/hpfs_vnops.c') diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c index 827b297..c9d6379 100644 --- a/sys/fs/hpfs/hpfs_vnops.c +++ b/sys/fs/hpfs/hpfs_vnops.c @@ -107,10 +107,13 @@ loop: (void) bwrite(bp); goto loop; } + VI_LOCK(vp); while (vp->v_numoutput) { - vp->v_flag |= VBWAIT; - (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "hpfsn", 0); + vp->v_iflag |= VI_BWAIT; + msleep((caddr_t)&vp->v_numoutput, VI_MTX(vp), PRIBIO + 1, + "hpfsn", 0); } + VI_UNLOCK(vp); #ifdef DIAGNOSTIC if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("hpfs_fsync: dirty", vp); -- cgit v1.1