aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1995-03-03 22:13:16 +0000
committerDavid Greenman <dg@FreeBSD.org>1995-03-03 22:13:16 +0000
commit22470903a0567c16e282b40242f87a2929ac0aad (patch)
tree9a2e43799ccdccaddab12d214c25f69027d8d3e7 /sys/kern/vfs_bio.c
parent1ea3a7260abdf37348120442bd94db29de91b1c9 (diff)
downloadsrc-22470903a0567c16e282b40242f87a2929ac0aad.tar.gz
src-22470903a0567c16e282b40242f87a2929ac0aad.zip
Fixes from John Dyson to work around vnode lock hang. Basically, remove
the VOP_BMAP calls, and add one to bdwrite. Submitted by: John Dyson
Notes
Notes: svn path=/head/; revision=6864
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index e1dea8e14431..437939900d27 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: vfs_bio.c,v 1.31 1995/02/25 01:46:26 davidg Exp $
+ * $Id: vfs_bio.c,v 1.32 1995/03/01 22:08:55 davidg Exp $
*/
/*
@@ -187,9 +187,6 @@ bread(struct vnode * vp, daddr_t blkno, int size, struct ucred * cred,
vfs_busy_pages(bp, 0);
VOP_STRATEGY(bp);
return (biowait(bp));
- } else if (bp->b_lblkno == bp->b_blkno) {
- VOP_BMAP(vp, bp->b_lblkno, (struct vnode **) 0,
- &bp->b_blkno, (int *) 0);
}
return (0);
}
@@ -223,9 +220,6 @@ breadn(struct vnode * vp, daddr_t blkno, int size,
vfs_busy_pages(bp, 0);
VOP_STRATEGY(bp);
++readwait;
- } else if (bp->b_lblkno == bp->b_blkno) {
- VOP_BMAP(vp, bp->b_lblkno, (struct vnode **) 0,
- &bp->b_blkno, (int *) 0);
}
for (i = 0; i < cnt; i++, rablkno++, rabsize++) {
if (inmem(vp, *rablkno))
@@ -332,6 +326,9 @@ bdwrite(struct buf * bp)
bp->b_flags |= B_DONE | B_DELWRI;
reassignbuf(bp, bp->b_vp);
}
+ if( bp->b_lblkno == bp->b_blkno) {
+ VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL);
+ }
brelse(bp);
return;
}
@@ -557,7 +554,8 @@ vfs_bio_awrite(struct buf * bp)
* this is a possible cluster write
*/
if (ncl != 1) {
- cluster_wbuild(vp, NULL, size, lblkno, ncl, -1);
+ bremfree(bp);
+ cluster_wbuild(vp, bp, size, lblkno, ncl, -1);
splx(s);
return;
}
@@ -647,6 +645,11 @@ trytofreespace:
}
goto start;
}
+
+ if( bp->b_flags & B_WANTED) {
+ bp->b_flags &= ~(B_WANTED|B_PDWANTED);
+ wakeup((caddr_t) bp);
+ }
bremfree(bp);
if (bp->b_flags & B_VMIO) {