From 0d67d3da58ffed5fd96023a0291ff9dffa6bbfc9 Mon Sep 17 00:00:00 2001 From: mckusick Date: Tue, 17 Nov 1998 00:31:12 +0000 Subject: 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. --- sys/kern/vfs_cluster.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sys/kern/vfs_cluster.c') 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); -- cgit v1.1