1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-28 16:43:09 +00:00

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
This commit is contained in:
David Greenman 1995-03-03 22:13:16 +00:00
parent 1ea3a7260a
commit 22470903a0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6864
3 changed files with 22 additions and 11 deletions

View File

@ -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 @@ getnewbuf(int slpflag, int slptimeo, int doingvmio)
}
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) {

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_alloc.c 8.8 (Berkeley) 2/21/94
* $Id: ffs_alloc.c,v 1.7 1995/02/14 06:14:28 phk Exp $
* $Id: ffs_alloc.c,v 1.8 1995/02/27 17:43:57 se Exp $
*/
#include <sys/param.h>
@ -198,6 +198,13 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
brelse(bp);
return (error);
}
if( bp->b_blkno == bp->b_lblkno) {
if( lbprev >= NDADDR)
panic("ffs_realloccg: lbprev out of range");
bp->b_blkno = fsbtodb(fs, bprev);
}
#ifdef QUOTA
error = chkdq(ip, (long)btodb(nsize - osize), cred, 0);
if (error) {
@ -273,7 +280,6 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
(u_long (*)())ffs_alloccg);
if (bno > 0) {
bp->b_blkno = fsbtodb(fs, bno);
/* (void) vnode_pager_uncache(ITOV(ip)); */
ffs_blkfree(ip, bprev, (long)osize);
if (nsize < request)
ffs_blkfree(ip, bno + numfrags(fs, nsize),

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_balloc.c 8.4 (Berkeley) 9/23/93
* $Id: ffs_balloc.c,v 1.3 1994/08/02 07:54:18 davidg Exp $
* $Id: ffs_balloc.c,v 1.4 1994/10/10 01:04:36 phk Exp $
*/
#include <sys/param.h>
@ -113,6 +113,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags)
brelse(bp);
return (error);
}
bp->b_blkno = fsbtodb(fs, nb);
*bpp = bp;
return (0);
}
@ -128,6 +129,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags)
brelse(bp);
return (error);
}
bp->b_blkno = fsbtodb(fs, nb);
} else {
error = ffs_realloccg(ip, bn,
ffs_blkpref(ip, bn, (int)bn, &ip->i_db[0]),