diff options
author | mckusick <mckusick@FreeBSD.org> | 1999-06-26 02:47:16 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 1999-06-26 02:47:16 +0000 |
commit | 5b58f2f951911f1075788268f99efccf1dba60eb (patch) | |
tree | 3f01ed42f71231eaa6a8cfa08b267634f1923fb1 /sys/gnu/ext2fs | |
parent | 3213b13650cb2206bbd62b5b1764d148750f63a0 (diff) | |
download | FreeBSD-src-5b58f2f951911f1075788268f99efccf1dba60eb.zip FreeBSD-src-5b58f2f951911f1075788268f99efccf1dba60eb.tar.gz |
Convert buffer locking from using the B_BUSY and B_WANTED flags to using
lockmgr locks. This commit should be functionally equivalent to the old
semantics. That is, all buffer locking is done with LK_EXCLUSIVE
requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will
be done in future commits.
Diffstat (limited to 'sys/gnu/ext2fs')
-rw-r--r-- | sys/gnu/ext2fs/ext2_vnops.c | 3 | ||||
-rw-r--r-- | sys/gnu/ext2fs/fs.h | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c index c3b1263..82eedd8 100644 --- a/sys/gnu/ext2fs/ext2_vnops.c +++ b/sys/gnu/ext2fs/ext2_vnops.c @@ -198,12 +198,11 @@ loop: s = splbio(); for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { nbp = TAILQ_NEXT(bp, b_vnbufs); - if ((bp->b_flags & B_BUSY)) + if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT)) continue; if ((bp->b_flags & B_DELWRI) == 0) panic("ext2_fsync: not dirty"); bremfree(bp); - bp->b_flags |= B_BUSY; splx(s); /* * Wait for I/O associated with indirect blocks to complete, diff --git a/sys/gnu/ext2fs/fs.h b/sys/gnu/ext2fs/fs.h index 17b5beb..b8dab54 100644 --- a/sys/gnu/ext2fs/fs.h +++ b/sys/gnu/ext2fs/fs.h @@ -173,8 +173,8 @@ extern u_char *fragtbl[]; s = splbio(); \ flags = (bp)->b_flags; \ (bp)->b_flags &= ~(B_DIRTY | B_LOCKED); \ + BUF_LOCK(bp, LK_EXCLUSIVE); \ bremfree(bp); \ - (bp)->b_flags |= B_BUSY; \ splx(s); \ if (flags & B_DIRTY) \ bdwrite(bp); \ |