summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>1999-06-26 02:47:16 +0000
committermckusick <mckusick@FreeBSD.org>1999-06-26 02:47:16 +0000
commit5b58f2f951911f1075788268f99efccf1dba60eb (patch)
tree3f01ed42f71231eaa6a8cfa08b267634f1923fb1 /sys/fs
parent3213b13650cb2206bbd62b5b1764d148750f63a0 (diff)
downloadFreeBSD-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/fs')
-rw-r--r--sys/fs/msdosfs/msdosfs_vnops.c5
-rw-r--r--sys/fs/specfs/spec_vnops.c10
2 files changed, 7 insertions, 8 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index 036ad2f..98e301e 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_vnops.c,v 1.84 1999/05/06 18:12:51 peter Exp $ */
+/* $Id: msdosfs_vnops.c,v 1.85 1999/05/11 19:54:43 phk Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */
/*-
@@ -842,12 +842,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("msdosfs_fsync: not dirty");
bremfree(bp);
- bp->b_flags |= B_BUSY;
splx(s);
(void) bwrite(bp);
goto loop;
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c
index dd4a279..9a467fd 100644
--- a/sys/fs/specfs/spec_vnops.c
+++ b/sys/fs/specfs/spec_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95
- * $Id: spec_vnops.c,v 1.87 1999/05/31 11:27:56 phk Exp $
+ * $Id: spec_vnops.c,v 1.88 1999/06/01 20:29:58 dt Exp $
*/
#include <sys/param.h>
@@ -492,16 +492,16 @@ 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("spec_fsync: not dirty");
if ((vp->v_flag & VOBJBUF) && (bp->b_flags & B_CLUSTEROK)) {
+ BUF_UNLOCK(bp);
vfs_bio_awrite(bp);
splx(s);
} else {
bremfree(bp);
- bp->b_flags |= B_BUSY;
splx(s);
bawrite(bp);
}
@@ -570,7 +570,7 @@ spec_freeblks(ap)
if ((bsw->d_flags & D_CANFREE) == 0)
return (0);
bp = geteblk(ap->a_length);
- bp->b_flags |= B_FREEBUF | B_BUSY;
+ bp->b_flags |= B_FREEBUF;
bp->b_dev = ap->a_vp->v_rdev;
bp->b_blkno = ap->a_addr;
bp->b_offset = dbtob(ap->a_addr);
@@ -806,7 +806,7 @@ spec_getpages(ap)
pmap_qenter(kva, ap->a_m, pcount);
/* Build a minimal buffer header. */
- bp->b_flags = B_BUSY | B_READ | B_CALL;
+ bp->b_flags = B_READ | B_CALL;
bp->b_iodone = spec_getpages_iodone;
/* B_PHYS is not set, but it is nice to fill this in. */
OpenPOWER on IntegriCloud