diff options
author | jeff <jeff@FreeBSD.org> | 2003-02-09 11:28:35 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-02-09 11:28:35 +0000 |
commit | 87e306ad712d6a7daef1073b7fb94c0fa90908d2 (patch) | |
tree | 48d962faa6bfdae347b467d003b11e355ce17172 /sys/ufs | |
parent | 75e9ed76e4bbf5978303d4d7ee581c86bef55c50 (diff) | |
download | FreeBSD-src-87e306ad712d6a7daef1073b7fb94c0fa90908d2.zip FreeBSD-src-87e306ad712d6a7daef1073b7fb94c0fa90908d2.tar.gz |
- Cleanup unlocked accesses to buf flags by introducing a new b_vflag member
that is protected by the vnode lock.
- Move B_SCANNED into b_vflags and call it BV_SCANNED.
- Create a vop_stdfsync() modeled after spec's sync.
- Replace spec_fsync, msdos_fsync, and hpfs_fsync with the stdfsync and some
fs specific processing. This gives all of these filesystems proper
behavior wrt MNT_WAIT/NOWAIT and the use of the B_SCANNED flag.
- Annotate the locking in buf.h
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 6213a49..4cba12f 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -184,7 +184,7 @@ ffs_fsync(ap) VI_LOCK(vp); loop: TAILQ_FOREACH(bp, &vp->v_dirtyblkhd, b_vnbufs) - bp->b_flags &= ~B_SCANNED; + bp->b_vflags &= ~BV_SCANNED; for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { nbp = TAILQ_NEXT(bp, b_vnbufs); /* @@ -195,22 +195,21 @@ loop: * it to be redirtied and it has not already been deferred, * or it is already being written. */ - if ((bp->b_flags & B_SCANNED) != 0) + if ((bp->b_vflags & BV_SCANNED) != 0) continue; - bp->b_flags |= B_SCANNED; + bp->b_vflags |= BV_SCANNED; if ((skipmeta == 1 && bp->b_lblkno < 0)) continue; + if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT)) + continue; if (!wait && LIST_FIRST(&bp->b_dep) != NULL && (bp->b_flags & B_DEFERRED) == 0 && buf_countdeps(bp, 0)) { bp->b_flags |= B_DEFERRED; + BUF_UNLOCK(bp); continue; } VI_UNLOCK(vp); - if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT)) { - VI_LOCK(vp); - continue; - } if ((bp->b_flags & B_DELWRI) == 0) panic("ffs_fsync: not dirty"); if (vp != bp->b_vp) |