diff options
author | dyson <dyson@FreeBSD.org> | 1995-09-04 00:21:16 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1995-09-04 00:21:16 +0000 |
commit | 251a16a6af0b7f6463e6619864a452faa67e82da (patch) | |
tree | 465f75274afdb8df4c9cc8c1841dd1321fa64e04 /sys/ufs | |
parent | 864d8a877ca6e1f78bb3b404658a992fa3bb2bdc (diff) | |
download | FreeBSD-src-251a16a6af0b7f6463e6619864a452faa67e82da.zip FreeBSD-src-251a16a6af0b7f6463e6619864a452faa67e82da.tar.gz |
Added VOP_GETPAGES/VOP_PUTPAGES and also the "backwards" block count
for VOP_BMAP. Updated affected filesystems...
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_subr.c | 4 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_balloc.c | 4 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_inode.c | 4 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_segment.c | 4 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_syscalls.c | 6 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_bmap.c | 33 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 4 |
7 files changed, 41 insertions, 18 deletions
diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index cbf9652..e6aa986 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_subr.c 8.2 (Berkeley) 9/21/93 - * $Id: ffs_subr.c,v 1.3 1994/10/10 01:04:38 phk Exp $ + * $Id: ffs_subr.c,v 1.4 1995/05/30 08:15:00 rgrimes Exp $ */ #include <sys/param.h> @@ -135,7 +135,7 @@ ffs_checkoverlap(bp, ip) if (ep == bp || (ep->b_flags & B_INVAL) || ep->b_vp == NULLVP) continue; - if (VOP_BMAP(ep->b_vp, (daddr_t)0, &vp, (daddr_t)0, NULL)) + if (VOP_BMAP(ep->b_vp, (daddr_t)0, &vp, (daddr_t)0, NULL, NULL)) continue; if (vp != ip->i_devvp) continue; diff --git a/sys/ufs/lfs/lfs_balloc.c b/sys/ufs/lfs/lfs_balloc.c index 81fac0d..316ddbf 100644 --- a/sys/ufs/lfs/lfs_balloc.c +++ b/sys/ufs/lfs/lfs_balloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_balloc.c 8.1 (Berkeley) 6/11/93 - * $Id: lfs_balloc.c,v 1.6 1995/04/09 06:03:41 davidg Exp $ + * $Id: lfs_balloc.c,v 1.7 1995/05/30 08:15:12 rgrimes Exp $ */ #include <sys/param.h> #include <sys/systm.h> @@ -79,7 +79,7 @@ lfs_balloc(vp, iosize, lbn, bpp) */ *bpp = NULL; - if (error = ufs_bmaparray(vp, lbn, &daddr, &indirs[0], &num, NULL )) + if (error = ufs_bmaparray(vp, lbn, &daddr, &indirs[0], &num, NULL, NULL )) return (error); *bpp = bp = getblk(vp, lbn, fs->lfs_bsize, 0, 0); diff --git a/sys/ufs/lfs/lfs_inode.c b/sys/ufs/lfs/lfs_inode.c index 61437c5..deab1c2 100644 --- a/sys/ufs/lfs/lfs_inode.c +++ b/sys/ufs/lfs/lfs_inode.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_inode.c 8.5 (Berkeley) 12/30/93 - * $Id: lfs_inode.c,v 1.8 1995/03/26 23:29:13 davidg Exp $ + * $Id: lfs_inode.c,v 1.9 1995/05/30 08:15:20 rgrimes Exp $ */ #include <sys/param.h> @@ -249,7 +249,7 @@ lfs_truncate(ap) for (lbn = olastblock; lbn >= lastblock;) { /* XXX use run length from bmap array to make this faster */ - ufs_bmaparray(vp, lbn, &daddr, a, &depth, NULL); + ufs_bmaparray(vp, lbn, &daddr, a, &depth, NULL, NULL); if (lbn == olastblock) for (i = NIADDR + 2; i--;) a_end[i] = a[i]; diff --git a/sys/ufs/lfs/lfs_segment.c b/sys/ufs/lfs/lfs_segment.c index 0e21faa..aa7b1c5 100644 --- a/sys/ufs/lfs/lfs_segment.c +++ b/sys/ufs/lfs/lfs_segment.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_segment.c 8.5 (Berkeley) 1/4/94 - * $Id: lfs_segment.c,v 1.12 1995/07/29 11:43:07 bde Exp $ + * $Id: lfs_segment.c,v 1.13 1995/08/16 16:14:13 bde Exp $ */ #include <sys/param.h> @@ -660,7 +660,7 @@ lfs_updatemeta(sp) (*sp->start_bpp)->b_blkno = off = fs->lfs_offset; fs->lfs_offset += db_per_fsb; - if (error = ufs_bmaparray(vp, lbn, &daddr, a, &num, NULL)) + if (error = ufs_bmaparray(vp, lbn, &daddr, a, &num, NULL, NULL)) panic("lfs_updatemeta: ufs_bmaparray %d", error); ip = VTOI(vp); switch (num) { diff --git a/sys/ufs/lfs/lfs_syscalls.c b/sys/ufs/lfs/lfs_syscalls.c index 5da8659..7d34c5b 100644 --- a/sys/ufs/lfs/lfs_syscalls.c +++ b/sys/ufs/lfs/lfs_syscalls.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_syscalls.c 8.5 (Berkeley) 4/20/94 - * $Id: lfs_syscalls.c,v 1.10 1995/05/30 08:15:25 rgrimes Exp $ + * $Id: lfs_syscalls.c,v 1.11 1995/07/29 11:43:08 bde Exp $ */ #include <sys/param.h> @@ -189,7 +189,7 @@ lfs_markv(p, uap, retval) /* If this BLOCK_INFO didn't contain a block, keep going. */ if (blkp->bi_lbn == LFS_UNUSED_LBN) continue; - if (VOP_BMAP(vp, blkp->bi_lbn, NULL, &b_daddr, NULL) || + if (VOP_BMAP(vp, blkp->bi_lbn, NULL, &b_daddr, NULL, NULL) || b_daddr != blkp->bi_daddr) continue; /* @@ -298,7 +298,7 @@ lfs_bmapv(p, uap, retval) if (VFS_VGET(mntp, blkp->bi_inode, &vp)) daddr = LFS_UNUSED_DADDR; else { - if (VOP_BMAP(vp, blkp->bi_lbn, NULL, &daddr, NULL)) + if (VOP_BMAP(vp, blkp->bi_lbn, NULL, &daddr, NULL, NULL)) daddr = LFS_UNUSED_DADDR; vput(vp); } diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c index 900d2c2..9be819f 100644 --- a/sys/ufs/ufs/ufs_bmap.c +++ b/sys/ufs/ufs/ufs_bmap.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_bmap.c 8.6 (Berkeley) 1/21/94 - * $Id: ufs_bmap.c,v 1.7 1995/03/28 07:58:16 bde Exp $ + * $Id: ufs_bmap.c,v 1.8 1995/05/30 08:15:31 rgrimes Exp $ */ #include <sys/param.h> @@ -67,6 +67,7 @@ ufs_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { /* @@ -79,7 +80,7 @@ ufs_bmap(ap) return (0); return (ufs_bmaparray(ap->a_vp, ap->a_bn, ap->a_bnp, NULL, NULL, - ap->a_runp)); + ap->a_runp, ap->a_runb)); } /* @@ -97,13 +98,14 @@ ufs_bmap(ap) */ int -ufs_bmaparray(vp, bn, bnp, ap, nump, runp) +ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb) struct vnode *vp; register daddr_t bn; daddr_t *bnp; struct indir *ap; int *nump; int *runp; + int *runb; { register struct inode *ip; struct buf *bp; @@ -134,6 +136,10 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp) maxrun = MAXPHYS / mp->mnt_stat.f_iosize - 1; } + if (runb) { + *runb = 0; + } + xap = ap == NULL ? a : ap; if (!nump) nump = # @@ -146,10 +152,19 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp) *bnp = blkptrtodb(ump, ip->i_db[bn]); if (*bnp == 0) *bnp = -1; - else if (runp) + else if (runp) { + daddr_t bnb = bn; for (++bn; bn < NDADDR && *runp < maxrun && is_sequential(ump, ip->i_db[bn - 1], ip->i_db[bn]); ++bn, ++*runp); + bn = bnb; + if (runb && (bn > 0)) { + for (--bn; (bn >= 0) && (*runb < maxrun) && + is_sequential(ump, ip->i_db[bn], + ip->i_db[bn+1]); + --bn, ++*runb); + } + } return (0); } @@ -195,12 +210,20 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp) } daddr = ((daddr_t *)bp->b_data)[xap->in_off]; - if (num == 1 && daddr && runp) + if (num == 1 && daddr && runp) { for (bn = xap->in_off + 1; bn < MNINDIR(ump) && *runp < maxrun && is_sequential(ump, ((daddr_t *)bp->b_data)[bn - 1], ((daddr_t *)bp->b_data)[bn]); ++bn, ++*runp); + bn = xap->in_off; + if (runb && bn) { + for(--bn; bn > 0 && *runb < maxrun && + is_sequential(ump, ((daddr_t *)bp->b_data)[bn], + ((daddr_t *)bp->b_data)[bn+1]); + --bn, ++*runb); + } + } } if (bp) brelse(bp); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 371cd06..3622004 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_vnops.c 8.10 (Berkeley) 4/1/94 - * $Id: ufs_vnops.c,v 1.26 1995/08/01 18:51:02 davidg Exp $ + * $Id: ufs_vnops.c,v 1.27 1995/08/28 09:19:17 julian Exp $ */ #include <sys/param.h> @@ -1650,7 +1650,7 @@ ufs_strategy(ap) if (vp->v_type == VBLK || vp->v_type == VCHR) panic("ufs_strategy: spec"); if (bp->b_blkno == bp->b_lblkno) { - error = VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL); + error = VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL, NULL); if (error) { bp->b_error = error; bp->b_flags |= B_ERROR; |