Deleted Added
full compact
vfs_cluster.c (106597) vfs_cluster.c (109623)
1/*-
2 * Copyright (c) 1993
3 * The Regents of the University of California. All rights reserved.
4 * Modifications/enhancements:
5 * Copyright (c) 1995 John S. Dyson. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 19 unchanged lines hidden (view full) ---

28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
1/*-
2 * Copyright (c) 1993
3 * The Regents of the University of California. All rights reserved.
4 * Modifications/enhancements:
5 * Copyright (c) 1995 John S. Dyson. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 19 unchanged lines hidden (view full) ---

28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
36 * $FreeBSD: head/sys/kern/vfs_cluster.c 106597 2002-11-07 22:41:08Z jhb $
36 * $FreeBSD: head/sys/kern/vfs_cluster.c 109623 2003-01-21 08:56:16Z alfred $
37 */
38
39#include "opt_debug_cluster.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/stdint.h>
44#include <sys/kernel.h>

--- 951 unchanged lines hidden (view full) ---

996{
997 struct cluster_save *buflist;
998 struct buf *bp;
999 daddr_t lbn;
1000 int i, len;
1001
1002 len = vp->v_lastw - vp->v_cstart + 1;
1003 buflist = malloc(sizeof(struct buf *) * (len + 1) + sizeof(*buflist),
37 */
38
39#include "opt_debug_cluster.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/stdint.h>
44#include <sys/kernel.h>

--- 951 unchanged lines hidden (view full) ---

996{
997 struct cluster_save *buflist;
998 struct buf *bp;
999 daddr_t lbn;
1000 int i, len;
1001
1002 len = vp->v_lastw - vp->v_cstart + 1;
1003 buflist = malloc(sizeof(struct buf *) * (len + 1) + sizeof(*buflist),
1004 M_SEGMENT, M_WAITOK);
1004 M_SEGMENT, 0);
1005 buflist->bs_nchildren = 0;
1006 buflist->bs_children = (struct buf **) (buflist + 1);
1007 for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++) {
1008 (void) bread(vp, lbn, last_bp->b_bcount, NOCRED, &bp);
1009 buflist->bs_children[i] = bp;
1010 if (bp->b_blkno == bp->b_lblkno)
1011 VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno,
1012 NULL, NULL);
1013 }
1014 buflist->bs_children[i] = bp = last_bp;
1015 if (bp->b_blkno == bp->b_lblkno)
1016 VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno,
1017 NULL, NULL);
1018 buflist->bs_nchildren = i + 1;
1019 return (buflist);
1020}
1005 buflist->bs_nchildren = 0;
1006 buflist->bs_children = (struct buf **) (buflist + 1);
1007 for (lbn = vp->v_cstart, i = 0; i < len; lbn++, i++) {
1008 (void) bread(vp, lbn, last_bp->b_bcount, NOCRED, &bp);
1009 buflist->bs_children[i] = bp;
1010 if (bp->b_blkno == bp->b_lblkno)
1011 VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno,
1012 NULL, NULL);
1013 }
1014 buflist->bs_children[i] = bp = last_bp;
1015 if (bp->b_blkno == bp->b_lblkno)
1016 VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno,
1017 NULL, NULL);
1018 buflist->bs_nchildren = i + 1;
1019 return (buflist);
1020}