diff options
author | mckusick <mckusick@FreeBSD.org> | 1998-11-17 00:31:12 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 1998-11-17 00:31:12 +0000 |
commit | 0d67d3da58ffed5fd96023a0291ff9dffa6bbfc9 (patch) | |
tree | 8220059bdfe2203b2be01b93f7dda84bb232b638 /sys/kern/vfs_cluster.c | |
parent | e3777e3acc5df7012eed016cf627ccddfec75048 (diff) | |
download | FreeBSD-src-0d67d3da58ffed5fd96023a0291ff9dffa6bbfc9.zip FreeBSD-src-0d67d3da58ffed5fd96023a0291ff9dffa6bbfc9.tar.gz |
Because buffers may be tossed and recreated at will under the new VM
system, the mapping from logical to physical block number may be lost.
Hence we have to check for a reconstituted buffer and redo the call to
VOP_BMAP if the physical block number has been lost.
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r-- | sys/kern/vfs_cluster.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index d0c665f..7632fa0 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94 - * $Id: vfs_cluster.c,v 1.72 1998/11/13 01:01:40 dg Exp $ + * $Id: vfs_cluster.c,v 1.73 1998/11/15 14:11:06 bde Exp $ */ #include "opt_debug_cluster.h" @@ -823,6 +823,7 @@ cluster_collectbufs(vp, last_bp) struct buf *last_bp; { struct cluster_save *buflist; + struct buf *bp; daddr_t lbn; int i, len; @@ -831,9 +832,13 @@ cluster_collectbufs(vp, last_bp) M_SEGMENT, M_WAITOK); buflist->bs_nchildren = 0; buflist->bs_children = (struct buf **) (buflist + 1); - for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++) - (void) bread(vp, lbn, last_bp->b_bcount, NOCRED, - &buflist->bs_children[i]); + for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++) { + (void) bread(vp, lbn, last_bp->b_bcount, NOCRED, &bp); + buflist->bs_children[i] = bp; + if (bp->b_blkno == bp->b_lblkno) + VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno, + NULL, NULL); + } buflist->bs_children[i] = last_bp; buflist->bs_nchildren = i + 1; return (buflist); |