diff options
33 files changed, 210 insertions, 66 deletions
diff --git a/sys/fs/cd9660/cd9660_bmap.c b/sys/fs/cd9660/cd9660_bmap.c index 32439ce..df18299 100644 --- a/sys/fs/cd9660/cd9660_bmap.c +++ b/sys/fs/cd9660/cd9660_bmap.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_bmap.c 8.3 (Berkeley) 1/23/94 - * $Id$ + * $Id: cd9660_bmap.c,v 1.2 1994/08/02 07:41:15 davidg Exp $ */ #include <sys/param.h> @@ -62,6 +62,7 @@ cd9660_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { struct iso_node *ip = VTOI(ap->a_vp); @@ -99,5 +100,9 @@ cd9660_bmap(ap) *ap->a_runp = nblk; } + if (ap->a_runb) { + *ap->a_runb = 0; + } + return 0; } diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index f738565..a187a66 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.3 (Berkeley) 1/23/94 - * $Id: cd9660_vnops.c,v 1.14 1995/05/30 08:05:05 rgrimes Exp $ + * $Id: cd9660_vnops.c,v 1.15 1995/08/02 13:00:40 dfr Exp $ */ #include <sys/param.h> @@ -830,7 +830,7 @@ cd9660_strategy(ap) panic("cd9660_strategy: spec"); if (bp->b_blkno == bp->b_lblkno) { if ((error = - VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL))) { + VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL, NULL))) { bp->b_error = error; bp->b_flags |= B_ERROR; biodone(bp); diff --git a/sys/fs/deadfs/dead_vnops.c b/sys/fs/deadfs/dead_vnops.c index d701c33..56a33bc 100644 --- a/sys/fs/deadfs/dead_vnops.c +++ b/sys/fs/deadfs/dead_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93 - * $Id: dead_vnops.c,v 1.5 1994/10/06 21:06:40 davidg Exp $ + * $Id: dead_vnops.c,v 1.6 1994/10/08 22:37:00 phk Exp $ */ #include <sys/param.h> @@ -301,12 +301,13 @@ dead_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { if (!chkvnlock(ap->a_vp)) return (EIO); - return (VOP_BMAP(ap->a_vp, ap->a_bn, ap->a_vpp, ap->a_bnp, ap->a_runp)); + return (VOP_BMAP(ap->a_vp, ap->a_bn, ap->a_vpp, ap->a_bnp, ap->a_runp, ap->a_runb)); } /* diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index 0f4f34b..8291ebb 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)fifo_vnops.c 8.2 (Berkeley) 1/4/94 - * $Id: fifo_vnops.c,v 1.8 1995/03/16 18:13:13 bde Exp $ + * $Id: fifo_vnops.c,v 1.10 1995/08/06 16:14:21 jkh Exp $ */ #include <sys/param.h> @@ -362,6 +362,8 @@ fifo_bmap(ap) daddr_t a_bn; struct vnode **a_vpp; daddr_t *a_bnp; + int *a_runp; + int *a_runb; } */ *ap; { @@ -371,6 +373,8 @@ fifo_bmap(ap) *ap->a_bnp = ap->a_bn; if (ap->a_runp != NULL) *ap->a_runp = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; return (0); } diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 5e8ca1d..6689d1d 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.21 1995/08/03 12:17:35 dfr Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.22 1995/08/25 20:12:23 bde Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -1816,6 +1816,7 @@ msdosfs_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { struct denode *dep = VTODE(ap->a_vp); @@ -1830,6 +1831,9 @@ msdosfs_bmap(ap) */ *ap->a_runp = 0; } + if (ap->a_runb) { + *ap->a_runb = 0; + } return pcbmap(dep, ap->a_bn, ap->a_bnp, 0); } diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 8e17858..1b27852 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94 - * $Id: spec_vnops.c,v 1.12 1995/07/08 04:03:12 davidg Exp $ + * $Id: spec_vnops.c,v 1.13 1995/07/29 11:40:31 bde Exp $ */ #include <sys/param.h> @@ -498,6 +498,8 @@ spec_bmap(ap) daddr_t a_bn; struct vnode **a_vpp; daddr_t *a_bnp; + int *a_runp; + int *a_runb; } */ *ap; { @@ -507,6 +509,8 @@ spec_bmap(ap) *ap->a_bnp = ap->a_bn; if (ap->a_runp != NULL) *ap->a_runp = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; return (0); } diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index 855620c..04db44f 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.6 (Berkeley) 2/17/94 - * $Id: union_vnops.c,v 1.10 1995/08/01 18:50:53 davidg Exp $ + * $Id: union_vnops.c,v 1.11 1995/08/17 11:53:51 bde Exp $ */ #include <sys/param.h> @@ -1337,6 +1337,7 @@ union_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { int error; @@ -1347,7 +1348,7 @@ union_bmap(ap) VOP_LOCK(vp); else FIXUP(VTOUNION(ap->a_vp)); - error = VOP_BMAP(vp, ap->a_bn, ap->a_vpp, ap->a_bnp, ap->a_runp); + error = VOP_BMAP(vp, ap->a_bn, ap->a_vpp, ap->a_bnp, ap->a_runp, ap->a_runb); if (dolock) VOP_UNLOCK(vp); diff --git a/sys/gnu/ext2fs/ext2_bmap.c b/sys/gnu/ext2fs/ext2_bmap.c index 900d2c2..9be819f 100644 --- a/sys/gnu/ext2fs/ext2_bmap.c +++ b/sys/gnu/ext2fs/ext2_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/gnu/fs/ext2fs/ext2_bmap.c b/sys/gnu/fs/ext2fs/ext2_bmap.c index 900d2c2..9be819f 100644 --- a/sys/gnu/fs/ext2fs/ext2_bmap.c +++ b/sys/gnu/fs/ext2fs/ext2_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/isofs/cd9660/cd9660_bmap.c b/sys/isofs/cd9660/cd9660_bmap.c index 32439ce..df18299 100644 --- a/sys/isofs/cd9660/cd9660_bmap.c +++ b/sys/isofs/cd9660/cd9660_bmap.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_bmap.c 8.3 (Berkeley) 1/23/94 - * $Id$ + * $Id: cd9660_bmap.c,v 1.2 1994/08/02 07:41:15 davidg Exp $ */ #include <sys/param.h> @@ -62,6 +62,7 @@ cd9660_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { struct iso_node *ip = VTOI(ap->a_vp); @@ -99,5 +100,9 @@ cd9660_bmap(ap) *ap->a_runp = nblk; } + if (ap->a_runb) { + *ap->a_runb = 0; + } + return 0; } diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index f738565..a187a66 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.3 (Berkeley) 1/23/94 - * $Id: cd9660_vnops.c,v 1.14 1995/05/30 08:05:05 rgrimes Exp $ + * $Id: cd9660_vnops.c,v 1.15 1995/08/02 13:00:40 dfr Exp $ */ #include <sys/param.h> @@ -830,7 +830,7 @@ cd9660_strategy(ap) panic("cd9660_strategy: spec"); if (bp->b_blkno == bp->b_lblkno) { if ((error = - VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL))) { + VOP_BMAP(vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL, NULL))) { bp->b_error = error; bp->b_flags |= B_ERROR; biodone(bp); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 8e8b9ad..0ffe00c 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -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.60 1995/08/28 09:18:53 julian Exp $ + * $Id: vfs_bio.c,v 1.61 1995/09/03 19:56:14 dyson Exp $ */ /* @@ -346,7 +346,7 @@ bdwrite(struct buf * bp) * the bmap then... So, this is important to do. */ if( bp->b_lblkno == bp->b_blkno) { - VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL); + VOP_BMAP(bp->b_vp, bp->b_lblkno, NULL, &bp->b_blkno, NULL, NULL); } /* diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index b4d9a42..a78a5e8 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.18 1995/09/03 19:56:15 dyson Exp $ + * $Id: vfs_cluster.c,v 1.19 1995/09/03 20:32:52 dyson Exp $ */ #include <sys/param.h> @@ -214,7 +214,7 @@ cluster_read(vp, filesize, lblkno, size, cred, bpp) rbp = NULL; if (!alreadyincore && (rablkno + 1) * size <= filesize && - !(error = VOP_BMAP(vp, rablkno, NULL, &blkno, &num_ra)) && + !(error = VOP_BMAP(vp, rablkno, NULL, &blkno, &num_ra, NULL)) && blkno != -1) { if (num_ra > vp->v_ralen) num_ra = vp->v_ralen; @@ -505,7 +505,7 @@ cluster_write(bp, filesize) */ if ((lbn + 1) * lblocksize != filesize && (bp->b_blkno == bp->b_lblkno) && - (VOP_BMAP(vp, lbn, NULL, &bp->b_blkno, &maxclen) || + (VOP_BMAP(vp, lbn, NULL, &bp->b_blkno, &maxclen, NULL) || bp->b_blkno == -1)) { bawrite(bp); vp->v_clen = 0; diff --git a/sys/kern/vnode_if.pl b/sys/kern/vnode_if.pl index 577deb9..37d53bd 100644 --- a/sys/kern/vnode_if.pl +++ b/sys/kern/vnode_if.pl @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93 -# $Id: vnode_if.sh,v 1.3 1995/07/07 13:41:27 davidg Exp $ +# $Id: vnode_if.sh,v 1.4 1995/08/01 18:50:40 davidg Exp $ # # Script to produce VFS front-end sugar. @@ -71,6 +71,9 @@ cat << END_OF_LEADING_COMMENT > $HEADER */ extern struct vnodeop_desc vop_default_desc; + +#include <vm/vm.h> +#include <vm/vm_page.h> END_OF_LEADING_COMMENT # Awk script to take vnode_if.src and turn it into vnode_if.h. @@ -166,6 +169,8 @@ cat << END_OF_LEADING_COMMENT > $CFILE #include <sys/param.h> #include <sys/mount.h> #include <sys/vnode.h> +#include <vm/vm.h> +#include <vm/vm_page.h> struct vnodeop_desc vop_default_desc = { 0, diff --git a/sys/kern/vnode_if.sh b/sys/kern/vnode_if.sh index 577deb9..37d53bd 100644 --- a/sys/kern/vnode_if.sh +++ b/sys/kern/vnode_if.sh @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93 -# $Id: vnode_if.sh,v 1.3 1995/07/07 13:41:27 davidg Exp $ +# $Id: vnode_if.sh,v 1.4 1995/08/01 18:50:40 davidg Exp $ # # Script to produce VFS front-end sugar. @@ -71,6 +71,9 @@ cat << END_OF_LEADING_COMMENT > $HEADER */ extern struct vnodeop_desc vop_default_desc; + +#include <vm/vm.h> +#include <vm/vm_page.h> END_OF_LEADING_COMMENT # Awk script to take vnode_if.src and turn it into vnode_if.h. @@ -166,6 +169,8 @@ cat << END_OF_LEADING_COMMENT > $CFILE #include <sys/param.h> #include <sys/mount.h> #include <sys/vnode.h> +#include <vm/vm.h> +#include <vm/vm_page.h> struct vnodeop_desc vop_default_desc = { 0, diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index c5f1094..7842fa1 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -31,7 +31,7 @@ # SUCH DAMAGE. # # @(#)vnode_if.src 8.3 (Berkeley) 2/3/94 -# $Id: vnode_if.src,v 1.5 1995/07/07 13:41:28 davidg Exp $ +# $Id: vnode_if.src,v 1.6 1995/08/01 18:50:41 davidg Exp $ # vop_lookup { IN struct vnode *dvp; @@ -226,6 +226,7 @@ vop_bmap { OUT struct vnode **vpp; IN daddr_t *bnp; OUT int *runp; + OUT int *runb; }; #vop_strategy { @@ -294,6 +295,20 @@ vop_update { IN int waitfor; }; +vop_getpages { + IN struct vnode *vp; + IN vm_page_t *m; + IN int count; + IN int reqpage; +}; + +vop_putpages { + IN struct vnode *vp; + IN vm_page_t *m; + IN int count; + IN int sync; + IN int *rtvals; +}; # Needs work: no vp? #vop_bwrite { # IN struct buf *bp; diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index d701c33..56a33bc 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93 - * $Id: dead_vnops.c,v 1.5 1994/10/06 21:06:40 davidg Exp $ + * $Id: dead_vnops.c,v 1.6 1994/10/08 22:37:00 phk Exp $ */ #include <sys/param.h> @@ -301,12 +301,13 @@ dead_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { if (!chkvnlock(ap->a_vp)) return (EIO); - return (VOP_BMAP(ap->a_vp, ap->a_bn, ap->a_vpp, ap->a_bnp, ap->a_runp)); + return (VOP_BMAP(ap->a_vp, ap->a_bn, ap->a_vpp, ap->a_bnp, ap->a_runp, ap->a_runb)); } /* diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index 78af2f2..8f00d6a 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -1,7 +1,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.6 1995/08/01 18:50:51 davidg Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.7 1995/09/02 07:09:01 julian Exp $ * * symlinks can wait 'til later. */ @@ -1044,6 +1044,7 @@ int devfs_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { DBPRINT(("bmap\n")); diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index 0f4f34b..8291ebb 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)fifo_vnops.c 8.2 (Berkeley) 1/4/94 - * $Id: fifo_vnops.c,v 1.8 1995/03/16 18:13:13 bde Exp $ + * $Id: fifo_vnops.c,v 1.10 1995/08/06 16:14:21 jkh Exp $ */ #include <sys/param.h> @@ -362,6 +362,8 @@ fifo_bmap(ap) daddr_t a_bn; struct vnode **a_vpp; daddr_t *a_bnp; + int *a_runp; + int *a_runb; } */ *ap; { @@ -371,6 +373,8 @@ fifo_bmap(ap) *ap->a_bnp = ap->a_bn; if (ap->a_runp != NULL) *ap->a_runp = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; return (0); } diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 8e17858..1b27852 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94 - * $Id: spec_vnops.c,v 1.12 1995/07/08 04:03:12 davidg Exp $ + * $Id: spec_vnops.c,v 1.13 1995/07/29 11:40:31 bde Exp $ */ #include <sys/param.h> @@ -498,6 +498,8 @@ spec_bmap(ap) daddr_t a_bn; struct vnode **a_vpp; daddr_t *a_bnp; + int *a_runp; + int *a_runb; } */ *ap; { @@ -507,6 +509,8 @@ spec_bmap(ap) *ap->a_bnp = ap->a_bn; if (ap->a_runp != NULL) *ap->a_runp = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; return (0); } diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c index 855620c..04db44f 100644 --- a/sys/miscfs/union/union_vnops.c +++ b/sys/miscfs/union/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.6 (Berkeley) 2/17/94 - * $Id: union_vnops.c,v 1.10 1995/08/01 18:50:53 davidg Exp $ + * $Id: union_vnops.c,v 1.11 1995/08/17 11:53:51 bde Exp $ */ #include <sys/param.h> @@ -1337,6 +1337,7 @@ union_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { int error; @@ -1347,7 +1348,7 @@ union_bmap(ap) VOP_LOCK(vp); else FIXUP(VTOUNION(ap->a_vp)); - error = VOP_BMAP(vp, ap->a_bn, ap->a_vpp, ap->a_bnp, ap->a_runp); + error = VOP_BMAP(vp, ap->a_bn, ap->a_vpp, ap->a_bnp, ap->a_runp, ap->a_runb); if (dolock) VOP_UNLOCK(vp); diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 5e8ca1d..6689d1d 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.21 1995/08/03 12:17:35 dfr Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.22 1995/08/25 20:12:23 bde Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -1816,6 +1816,7 @@ msdosfs_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { struct denode *dep = VTODE(ap->a_vp); @@ -1830,6 +1831,9 @@ msdosfs_bmap(ap) */ *ap->a_runp = 0; } + if (ap->a_runb) { + *ap->a_runb = 0; + } return pcbmap(dep, ap->a_bn, ap->a_bnp, 0); } diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 1a08ca2..5b25d30 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94 - * $Id: nfs_vnops.c,v 1.22 1995/07/24 16:38:05 dfr Exp $ + * $Id: nfs_vnops.c,v 1.23 1995/08/01 18:50:59 davidg Exp $ */ /* @@ -2600,6 +2600,7 @@ nfs_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { register struct vnode *vp = ap->a_vp; @@ -2610,6 +2611,8 @@ nfs_bmap(ap) *ap->a_bnp = ap->a_bn * btodb(vp->v_mount->mnt_stat.f_iosize); if (ap->a_runp != NULL) *ap->a_runp = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; return (0); } diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 1a08ca2..5b25d30 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94 - * $Id: nfs_vnops.c,v 1.22 1995/07/24 16:38:05 dfr Exp $ + * $Id: nfs_vnops.c,v 1.23 1995/08/01 18:50:59 davidg Exp $ */ /* @@ -2600,6 +2600,7 @@ nfs_bmap(ap) struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; + int *a_runb; } */ *ap; { register struct vnode *vp = ap->a_vp; @@ -2610,6 +2611,8 @@ nfs_bmap(ap) *ap->a_bnp = ap->a_bn * btodb(vp->v_mount->mnt_stat.f_iosize); if (ap->a_runp != NULL) *ap->a_runp = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; return (0); } diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk index 577deb9..37d53bd 100644 --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93 -# $Id: vnode_if.sh,v 1.3 1995/07/07 13:41:27 davidg Exp $ +# $Id: vnode_if.sh,v 1.4 1995/08/01 18:50:40 davidg Exp $ # # Script to produce VFS front-end sugar. @@ -71,6 +71,9 @@ cat << END_OF_LEADING_COMMENT > $HEADER */ extern struct vnodeop_desc vop_default_desc; + +#include <vm/vm.h> +#include <vm/vm_page.h> END_OF_LEADING_COMMENT # Awk script to take vnode_if.src and turn it into vnode_if.h. @@ -166,6 +169,8 @@ cat << END_OF_LEADING_COMMENT > $CFILE #include <sys/param.h> #include <sys/mount.h> #include <sys/vnode.h> +#include <vm/vm.h> +#include <vm/vm_page.h> struct vnodeop_desc vop_default_desc = { 0, 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; diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 6e89635..cefc6f8 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91 - * $Id: vnode_pager.c,v 1.43 1995/07/09 06:58:03 davidg Exp $ + * $Id: vnode_pager.c,v 1.44 1995/07/13 08:48:47 davidg Exp $ */ /* @@ -207,7 +207,7 @@ vnode_pager_haspage(object, offset, before, after) * requested page. */ while (TRUE) { - err = VOP_BMAP(vp, startblock, (struct vnode **) 0, &bn, &run); + err = VOP_BMAP(vp, startblock, (struct vnode **) 0, &bn, &run, NULL); if (err || bn == -1) { if (startblock < reqblock) { startblock++; @@ -229,7 +229,7 @@ vnode_pager_haspage(object, offset, before, after) } } - err = VOP_BMAP(vp, reqblock, (struct vnode **) 0, &bn, after); + err = VOP_BMAP(vp, reqblock, (struct vnode **) 0, &bn, after, NULL); if (err) return TRUE; return ((long) bn < 0 ? FALSE : TRUE); @@ -379,7 +379,7 @@ vnode_pager_addr(vp, address, run) vblock = address / bsize; voffset = address % bsize; - err = VOP_BMAP(vp, vblock, &rtvp, &block, run); + err = VOP_BMAP(vp, vblock, &rtvp, &block, run, NULL); if (err || (block == -1)) rtaddress = -1; @@ -427,7 +427,7 @@ vnode_pager_input_smlfs(object, m) bsize = vp->v_mount->mnt_stat.f_iosize; - VOP_BMAP(vp, 0, &dp, 0, 0); + VOP_BMAP(vp, 0, &dp, 0, NULL, NULL); kva = vm_pager_map_page(m); @@ -583,7 +583,7 @@ vnode_pager_getpages(object, m, count, reqpage) /* * if we can't bmap, use old VOP code */ - if (VOP_BMAP(vp, 0, &dp, 0, 0)) { + if (VOP_BMAP(vp, 0, &dp, 0, NULL, NULL)) { for (i = 0; i < count; i++) { if (i != reqpage) { vnode_pager_freepage(m[i]); |