diff options
| author | hannken <hannken@NetBSD.org> | 2004-01-25 18:06:48 +0000 |
|---|---|---|
| committer | hannken <hannken@NetBSD.org> | 2004-01-25 18:06:48 +0000 |
| commit | 3db4e2acd8e5eada26b08616d608d82fc4af74a0 (patch) | |
| tree | 1b03b5d463d3843c9d4fd5aabc3aff9b93dd232b /sys | |
| parent | d7f6cbf8bcfc796c13c751a3bcda9e4ce70cb790 (diff) | |
Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.
VOP_STRATEGY(bp) is replaced by one of two new functions:
- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.
DEV_STRATEGY(bp) is used only for block-to-block device situations.
Diffstat (limited to 'sys')
35 files changed, 156 insertions, 199 deletions
diff --git a/sys/dev/ata/ata_raid.c b/sys/dev/ata/ata_raid.c index a777f8f034e..545202a1133 100644 --- a/sys/dev/ata/ata_raid.c +++ b/sys/dev/ata/ata_raid.c @@ -1,4 +1,4 @@ -/* $NetBSD: ata_raid.c,v 1.7 2003/12/14 05:37:25 thorpej Exp $ */ +/* $NetBSD: ata_raid.c,v 1.8 2004/01/25 18:06:48 hannken Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.7 2003/12/14 05:37:25 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.8 2004/01/25 18:06:48 hannken Exp $"); #include <sys/param.h> #include <sys/buf.h> @@ -302,14 +302,13 @@ ata_raid_config_block_rw(struct vnode *vp, daddr_t blkno, void *buf, BUF_INIT(bp); bp->b_vp = vp; - bp->b_dev = vp->v_rdev; bp->b_blkno = blkno; bp->b_bcount = bp->b_resid = size; bp->b_flags = bflags; bp->b_proc = curproc; bp->b_data = buf; - VOP_STRATEGY(bp); + VOP_STRATEGY(vp, bp); error = biowait(bp); s = splbio(); diff --git a/sys/dev/ata/ld_ataraid.c b/sys/dev/ata/ld_ataraid.c index 3c96adb59ac..daf79f16b3a 100644 --- a/sys/dev/ata/ld_ataraid.c +++ b/sys/dev/ata/ld_ataraid.c @@ -1,4 +1,4 @@ -/* $NetBSD: ld_ataraid.c,v 1.9 2003/12/14 02:46:34 thorpej Exp $ */ +/* $NetBSD: ld_ataraid.c,v 1.10 2004/01/25 18:06:48 hannken Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.9 2003/12/14 02:46:34 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.10 2004/01/25 18:06:48 hannken Exp $"); #include "rnd.h" @@ -239,7 +239,6 @@ ld_ataraid_make_cbuf(struct ld_ataraid_softc *sc, struct buf *bp, cbp->cb_buf.b_iodone = sc->sc_iodone; cbp->cb_buf.b_proc = bp->b_proc; cbp->cb_buf.b_vp = sc->sc_vnodes[comp]; - cbp->cb_buf.b_dev = sc->sc_vnodes[comp]->v_rdev; cbp->cb_buf.b_blkno = bn + sc->sc_aai->aai_offset; cbp->cb_buf.b_data = addr; cbp->cb_buf.b_bcount = bcount; @@ -311,7 +310,7 @@ ld_ataraid_start_span(struct ld_softc *ld, struct buf *bp) SIMPLEQ_REMOVE_HEAD(&cbufq, cb_q); if ((cbp->cb_buf.b_flags & B_READ) == 0) cbp->cb_buf.b_vp->v_numoutput++; - VOP_STRATEGY(&cbp->cb_buf); + VOP_STRATEGY(cbp->cb_buf.b_vp, &cbp->cb_buf); } return (0); @@ -376,7 +375,7 @@ ld_ataraid_start_raid0(struct ld_softc *ld, struct buf *bp) SIMPLEQ_REMOVE_HEAD(&cbufq, cb_q); if ((cbp->cb_buf.b_flags & B_READ) == 0) cbp->cb_buf.b_vp->v_numoutput++; - VOP_STRATEGY(&cbp->cb_buf); + VOP_STRATEGY(cbp->cb_buf.b_vp, &cbp->cb_buf); } return (0); diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c index 2d63130abe6..abbf9a2a404 100644 --- a/sys/dev/ccd.c +++ b/sys/dev/ccd.c @@ -1,4 +1,4 @@ -/* $NetBSD: ccd.c,v 1.94 2004/01/10 14:39:50 yamt Exp $ */ +/* $NetBSD: ccd.c,v 1.95 2004/01/25 18:06:48 hannken Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 1999 The NetBSD Foundation, Inc. @@ -125,7 +125,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.94 2004/01/10 14:39:50 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.95 2004/01/25 18:06:48 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -772,7 +772,7 @@ ccdstart(cs) SIMPLEQ_REMOVE_HEAD(&cbufq, cb_q); if ((cbp->cb_buf.b_flags & B_READ) == 0) cbp->cb_buf.b_vp->v_numoutput++; - VOP_STRATEGY(&cbp->cb_buf); + DEV_STRATEGY(&cbp->cb_buf); } } } @@ -853,7 +853,7 @@ ccdbuffer(cs, bp, bn, addr, bcount) cbp->cb_buf.b_flags = bp->b_flags | B_CALL; cbp->cb_buf.b_iodone = ccdiodone; cbp->cb_buf.b_proc = bp->b_proc; - cbp->cb_buf.b_dev = ci->ci_dev; /* XXX */ + cbp->cb_buf.b_dev = ci->ci_dev; cbp->cb_buf.b_blkno = cbn + cboff; cbp->cb_buf.b_data = addr; cbp->cb_buf.b_vp = ci->ci_vp; diff --git a/sys/dev/cgd.c b/sys/dev/cgd.c index 7cefc894839..114e261194c 100644 --- a/sys/dev/cgd.c +++ b/sys/dev/cgd.c @@ -1,4 +1,4 @@ -/* $NetBSD: cgd.c,v 1.13 2004/01/10 14:39:50 yamt Exp $ */ +/* $NetBSD: cgd.c,v 1.14 2004/01/25 18:06:48 hannken Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.13 2004/01/10 14:39:50 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.14 2004/01/25 18:06:48 hannken Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -311,7 +311,6 @@ cgdstart(struct dk_softc *dksc, struct buf *bp) cbp->cb_buf.b_flags = bp->b_flags | B_CALL; cbp->cb_buf.b_iodone = cgdiodone; cbp->cb_buf.b_proc = bp->b_proc; - cbp->cb_buf.b_dev = cs->sc_tdev; cbp->cb_buf.b_blkno = bn; cbp->cb_buf.b_vp = cs->sc_tvn; cbp->cb_buf.b_bcount = bp->b_bcount; @@ -324,7 +323,7 @@ cgdstart(struct dk_softc *dksc, struct buf *bp) if ((cbp->cb_buf.b_flags & B_READ) == 0) cbp->cb_buf.b_vp->v_numoutput++; - VOP_STRATEGY(&cbp->cb_buf); + VOP_STRATEGY(cs->sc_tvn, &cbp->cb_buf); } void diff --git a/sys/dev/fss.c b/sys/dev/fss.c index 487035f5b9c..98bfec7a346 100644 --- a/sys/dev/fss.c +++ b/sys/dev/fss.c @@ -1,4 +1,4 @@ -/* $NetBSD: fss.c,v 1.4 2004/01/11 19:05:27 hannken Exp $ */ +/* $NetBSD: fss.c,v 1.5 2004/01/25 18:06:48 hannken Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.4 2004/01/11 19:05:27 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.5 2004/01/25 18:06:48 hannken Exp $"); #include "fss.h" #include "opt_ddb.h" @@ -507,7 +507,7 @@ fss_copy_on_write(struct fss_softc *sc, struct buf *bp) * Lookup and open needed files. * * Returns dev and size of the underlying block device. - * Initializes the fields sc_mntname, sc_bs_vp, sc_mount and sc_strategy + * Initializes the fields sc_mntname, sc_bs_vp and sc_mount */ static int fss_create_files(struct fss_softc *sc, struct fss_set *fss, @@ -517,7 +517,6 @@ fss_create_files(struct fss_softc *sc, struct fss_set *fss, struct partinfo dpart; struct vattr va; struct nameidata nd; - const struct bdevsw *bdevsw; /* * Get the mounted file system. @@ -560,10 +559,6 @@ fss_create_files(struct fss_softc *sc, struct fss_set *fss, *bsize = (off_t)dpart.disklab->d_secsize*dpart.part->p_size; vrele(nd.ni_vp); - if ((bdevsw = bdevsw_lookup(*bdev)) == NULL) - return EINVAL; - sc->sc_strategy = bdevsw->d_strategy; - /* * Get the backing store */ @@ -928,7 +923,7 @@ restart: bp->b_private = scp; bp->b_iodone = fss_cluster_iodone; - (*sc->sc_strategy)(bp); + DEV_STRATEGY(bp); FSS_LOCK(sc, s); scp->fc_xfercount++; @@ -1002,7 +997,7 @@ fss_write_cluster(struct fss_cache *scp, u_int32_t cl) bp->b_vp->v_numoutput++; BIO_SETPRIO(bp, BPRIO_TIMECRITICAL); - VOP_STRATEGY(bp); + VOP_STRATEGY(vp, bp); FSS_LOCK(sc, s); scp->fc_xfercount++; @@ -1069,7 +1064,7 @@ fss_bs_io(struct fss_softc *sc, fss_io_type rw, if ((bp->b_flags & B_READ) == 0 || cl < sc->sc_indir_size) BIO_SETPRIO(bp, BPRIO_TIMECRITICAL); - VOP_STRATEGY(bp); + VOP_STRATEGY(vp, bp); error = biowait(bp); @@ -1256,7 +1251,7 @@ fss_bs_thread(void *arg) nbp->b_dev = sc->sc_bdev; nbp->b_vp = NULLVP; - (*sc->sc_strategy)(nbp); + DEV_STRATEGY(nbp); if (biowait(nbp) != 0) { bp->b_resid = bp->b_bcount; diff --git a/sys/dev/fssvar.h b/sys/dev/fssvar.h index 6a86f46d65f..2dd0e1bd444 100644 --- a/sys/dev/fssvar.h +++ b/sys/dev/fssvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: fssvar.h,v 1.2 2004/01/11 19:05:27 hannken Exp $ */ +/* $NetBSD: fssvar.h,v 1.3 2004/01/25 18:06:48 hannken Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -143,7 +143,6 @@ struct fss_softc { char sc_mntname[MNAMELEN]; /* Mount point */ struct timeval sc_time; /* Time this snapshot was taken */ dev_t sc_bdev; /* Underlying block device */ - void (*sc_strategy)(struct buf *); /* And its strategy */ struct vnode *sc_bs_vp; /* Our backing store */ off_t sc_bs_size; /* Its size in bytes */ int sc_bs_bshift; /* Shift of backing store block */ diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 5f3b30f81b7..5fbb521e5d0 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.172 2004/01/10 14:39:50 yamt Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.173 2004/01/25 18:06:48 hannken Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -146,7 +146,7 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.172 2004/01/10 14:39:50 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.173 2004/01/25 18:06:48 hannken Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -1878,7 +1878,7 @@ rf_DispatchKernelIO(RF_DiskQueue_t *queue, RF_DiskQueueData_t *req) if ((raidbp->rf_buf.b_flags & B_READ) == 0) { raidbp->rf_buf.b_vp->v_numoutput++; } - VOP_STRATEGY(&raidbp->rf_buf); + VOP_STRATEGY(raidbp->rf_buf.b_vp, &raidbp->rf_buf); break; diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index 6ec23207a38..11790f68186 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $NetBSD: vnd.c,v 1.105 2004/01/10 14:39:50 yamt Exp $ */ +/* $NetBSD: vnd.c,v 1.106 2004/01/25 18:06:48 hannken Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.105 2004/01/10 14:39:50 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.106 2004/01/25 18:06:48 hannken Exp $"); #if defined(_KERNEL_OPT) #include "fs_nfs.h" @@ -643,7 +643,7 @@ vndstart(vnd) if ((bp->b_flags & B_READ) == 0) bp->b_vp->v_numoutput++; - VOP_STRATEGY(bp); + VOP_STRATEGY(bp->b_vp, bp); } vnd->sc_flags &= ~VNF_BUSY; } diff --git a/sys/fs/adosfs/advnops.c b/sys/fs/adosfs/advnops.c index b4e9dbe1dd9..607aec6bba3 100644 --- a/sys/fs/adosfs/advnops.c +++ b/sys/fs/adosfs/advnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: advnops.c,v 1.6 2003/06/29 22:31:07 fvdl Exp $ */ +/* $NetBSD: advnops.c,v 1.7 2004/01/25 18:06:48 hannken Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.6 2003/06/29 22:31:07 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.7 2004/01/25 18:06:48 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_quota.h" @@ -391,7 +391,6 @@ adosfs_strategy(v) #ifdef ADOSFS_DIAGNOSTIC advopprint(sp); #endif - error = 0; bp = sp->a_bp; if (bp->b_vp == NULL) { bp->b_flags |= B_ERROR; @@ -415,8 +414,7 @@ adosfs_strategy(v) goto reterr; } vp = ap->amp->devvp; - bp->b_dev = vp->v_rdev; - VOCALL(vp->v_op, VOFFSET(vop_strategy), sp); + error = VOP_STRATEGY(vp, bp); reterr: #ifdef ADOSFS_DIAGNOSTIC printf(" %d)", error); diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 9f0f2b82a87..1f30973a2e5 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_vnops.c,v 1.6 2003/08/07 16:31:36 agc Exp $ */ +/* $NetBSD: cd9660_vnops.c,v 1.7 2004/01/25 18:06:48 hannken Exp $ */ /*- * Copyright (c) 1994 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.6 2003/08/07 16:31:36 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.7 2004/01/25 18:06:48 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -771,9 +771,7 @@ cd9660_strategy(v) return (0); } vp = ip->i_devvp; - bp->b_dev = vp->v_rdev; - VOCALL (vp->v_op, VOFFSET(vop_strategy), ap); - return (0); + return (VOP_STRATEGY(vp, bp)); } /* diff --git a/sys/fs/filecorefs/filecore_vnops.c b/sys/fs/filecorefs/filecore_vnops.c index 9e5937d82b1..5b8ffaf426c 100644 --- a/sys/fs/filecorefs/filecore_vnops.c +++ b/sys/fs/filecorefs/filecore_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: filecore_vnops.c,v 1.6 2003/08/07 16:31:38 agc Exp $ */ +/* $NetBSD: filecore_vnops.c,v 1.7 2004/01/25 18:06:48 hannken Exp $ */ /*- * Copyright (c) 1994 The Regents of the University of California. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: filecore_vnops.c,v 1.6 2003/08/07 16:31:38 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: filecore_vnops.c,v 1.7 2004/01/25 18:06:48 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -466,9 +466,7 @@ filecore_strategy(v) return (0); } vp = ip->i_devvp; - bp->b_dev = vp->v_rdev; - VOCALL (vp->v_op, VOFFSET(vop_strategy), ap); - return (0); + return (VOP_STRATEGY(vp, bp)); } /* diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 19b445740f0..e4da3622ab1 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_vnops.c,v 1.7 2003/09/07 22:09:11 itojun Exp $ */ +/* $NetBSD: msdosfs_vnops.c,v 1.8 2004/01/25 18:06:48 hannken Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.7 2003/09/07 22:09:11 itojun Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.8 2004/01/25 18:06:48 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1770,9 +1770,7 @@ msdosfs_strategy(v) */ vp = dep->de_devvp; - bp->b_dev = vp->v_rdev; - VOCALL(vp->v_op, VOFFSET(vop_strategy), ap); - return (0); + return (VOP_STRATEGY(vp, bp)); } int diff --git a/sys/fs/union/union_vnops.c b/sys/fs/union/union_vnops.c index f725b8176f7..f3d2b9c69e0 100644 --- a/sys/fs/union/union_vnops.c +++ b/sys/fs/union/union_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: union_vnops.c,v 1.7 2003/08/07 16:31:40 agc Exp $ */ +/* $NetBSD: union_vnops.c,v 1.8 2004/01/25 18:06:48 hannken Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995 @@ -72,7 +72,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.7 2003/08/07 16:31:40 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.8 2004/01/25 18:06:48 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1986,27 +1986,21 @@ union_strategy(v) void *v; { struct vop_strategy_args /* { + struct vnode *a_vp; struct buf *a_bp; } */ *ap = v; + struct vnode *ovp = OTHERVP(ap->a_vp); struct buf *bp = ap->a_bp; - int error; - struct vnode *savedvp; - - savedvp = bp->b_vp; - bp->b_vp = OTHERVP(bp->b_vp); #ifdef DIAGNOSTIC - if (bp->b_vp == NULLVP) + if (ovp == NULLVP) panic("union_strategy: nil vp"); if (((bp->b_flags & B_READ) == 0) && - (bp->b_vp == LOWERVP(savedvp))) + (ovp == LOWERVP(bp->b_vp))) panic("union_strategy: writing to lowervp"); #endif - error = VOP_STRATEGY(bp); - bp->b_vp = savedvp; - - return (error); + return (VOP_STRATEGY(ovp, bp)); } int diff --git a/sys/kern/vnode_if.c b/sys/kern/vnode_if.c index f1967a18730..3f38af9aa35 100644 --- a/sys/kern/vnode_if.c +++ b/sys/kern/vnode_if.c @@ -1,13 +1,13 @@ -/* $NetBSD: vnode_if.c,v 1.46 2004/01/25 18:02:04 hannken Exp $ */ +/* $NetBSD: vnode_if.c,v 1.47 2004/01/25 18:06:48 hannken Exp $ */ /* * Warning: This file is generated automatically. * (Modifications made here may easily be lost!) * * Created from the file: - * NetBSD: vnode_if.src,v 1.37 2004/01/24 01:40:57 wiz Exp + * NetBSD: vnode_if.src,v 1.38 2004/01/25 18:02:04 hannken Exp * by the script: - * NetBSD: vnode_if.sh,v 1.33 2003/08/07 16:32:05 agc Exp + * NetBSD: vnode_if.sh,v 1.34 2004/01/25 18:02:04 hannken Exp */ /* @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.46 2004/01/25 18:02:04 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.47 2004/01/25 18:06:48 hannken Exp $"); /* diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index fe836d21887..22682d2839e 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: dead_vnops.c,v 1.33 2003/08/07 16:32:32 agc Exp $ */ +/* $NetBSD: dead_vnops.c,v 1.34 2004/01/25 18:06:48 hannken Exp $ */ /* * Copyright (c) 1989, 1993 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dead_vnops.c,v 1.33 2003/08/07 16:32:32 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dead_vnops.c,v 1.34 2004/01/25 18:06:48 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -271,14 +271,15 @@ dead_strategy(v) { struct vop_strategy_args /* { + struct vnode *a_vp; struct buf *a_bp; } */ *ap = v; - if (ap->a_bp->b_vp == NULL || !chkvnlock(ap->a_bp->b_vp)) { + if (ap->a_vp == NULL || !chkvnlock(ap->a_vp)) { ap->a_bp->b_flags |= B_ERROR; biodone(ap->a_bp); return (EIO); } - return (VOP_STRATEGY(ap->a_bp)); + return (VOP_STRATEGY(ap->a_vp, ap->a_bp)); } /* diff --git a/sys/miscfs/genfs/genfs_vnops.c b/sys/miscfs/genfs/genfs_vnops.c index 71ffe96abe6..5dd8ce718ad 100644 --- a/sys/miscfs/genfs/genfs_vnops.c +++ b/sys/miscfs/genfs/genfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: genfs_vnops.c,v 1.84 2004/01/10 14:39:50 yamt Exp $ */ +/* $NetBSD: genfs_vnops.c,v 1.85 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.84 2004/01/10 14:39:50 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.85 2004/01/25 18:06:49 hannken Exp $"); #include "opt_nfsserver.h" @@ -826,7 +826,7 @@ genfs_getpages(void *v) BIO_SETPRIO(bp, BPRIO_TIMELIMITED); else BIO_SETPRIO(bp, BPRIO_TIMECRITICAL); - VOP_STRATEGY(bp); + VOP_STRATEGY(bp->b_vp, bp); } loopdone: @@ -1499,7 +1499,7 @@ genfs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int flags) BIO_SETPRIO(bp, BPRIO_TIMENONCRITICAL); else BIO_SETPRIO(bp, BPRIO_TIMECRITICAL); - VOP_STRATEGY(bp); + VOP_STRATEGY(bp->b_vp, bp); } if (skipbytes) { UVMHIST_LOG(ubchist, "skipbytes %d", skipbytes, 0,0,0); diff --git a/sys/miscfs/genfs/layer_extern.h b/sys/miscfs/genfs/layer_extern.h index 997cd7e4021..3fe234e10eb 100644 --- a/sys/miscfs/genfs/layer_extern.h +++ b/sys/miscfs/genfs/layer_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: layer_extern.h,v 1.10 2003/12/04 19:38:24 atatat Exp $ */ +/* $NetBSD: layer_extern.h,v 1.11 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1999 National Aeronautics & Space Administration @@ -100,7 +100,6 @@ int layer_getattr __P((void *)); int layer_inactive __P((void *)); int layer_reclaim __P((void *)); int layer_print __P((void *)); -int layer_strategy __P((void *)); int layer_bwrite __P((void *)); int layer_bmap __P((void *)); int layer_lock __P((void *)); diff --git a/sys/miscfs/genfs/layer_vnops.c b/sys/miscfs/genfs/layer_vnops.c index 55446c4e767..f79181c0bb6 100644 --- a/sys/miscfs/genfs/layer_vnops.c +++ b/sys/miscfs/genfs/layer_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: layer_vnops.c,v 1.13 2003/11/30 20:53:48 wiz Exp $ */ +/* $NetBSD: layer_vnops.c,v 1.14 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1999 National Aeronautics & Space Administration @@ -67,7 +67,7 @@ * * Ancestors: * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92 - * $Id: layer_vnops.c,v 1.13 2003/11/30 20:53:48 wiz Exp $ + * $Id: layer_vnops.c,v 1.14 2004/01/25 18:06:49 hannken Exp $ * ...and... * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project */ @@ -232,7 +232,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: layer_vnops.c,v 1.13 2003/11/30 20:53:48 wiz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: layer_vnops.c,v 1.14 2004/01/25 18:06:49 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -832,33 +832,7 @@ layer_print(v) } /* - * XXX - vop_strategy must be hand coded because it has no - * vnode in its arguments. - * This goes away with a merged VM/buffer cache. - */ -int -layer_strategy(v) - void *v; -{ - struct vop_strategy_args /* { - struct buf *a_bp; - } */ *ap = v; - struct buf *bp = ap->a_bp; - int error; - struct vnode *savedvp; - - savedvp = bp->b_vp; - bp->b_vp = LAYERVPTOLOWERVP(bp->b_vp); - - error = VOP_STRATEGY(bp); - - bp->b_vp = savedvp; - - return (error); -} - -/* - * XXX - like vop_strategy, vop_bwrite must be hand coded because it has no + * XXX - vop_bwrite must be hand coded because it has no * vnode in its arguments. * This goes away with a merged VM/buffer cache. */ diff --git a/sys/miscfs/nullfs/null_vnops.c b/sys/miscfs/nullfs/null_vnops.c index 6a71611d714..3c6482cef07 100644 --- a/sys/miscfs/nullfs/null_vnops.c +++ b/sys/miscfs/nullfs/null_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: null_vnops.c,v 1.27 2003/08/07 16:32:39 agc Exp $ */ +/* $NetBSD: null_vnops.c,v 1.28 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1999 National Aeronautics & Space Administration @@ -203,7 +203,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: null_vnops.c,v 1.27 2003/08/07 16:32:39 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: null_vnops.c,v 1.28 2004/01/25 18:06:49 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -239,7 +239,6 @@ const struct vnodeopv_entry_desc null_vnodeop_entries[] = { { &vop_open_desc, layer_open }, /* mount option handling */ - { &vop_strategy_desc, layer_strategy }, { &vop_bwrite_desc, layer_bwrite }, { &vop_bmap_desc, layer_bmap }, { &vop_getpages_desc, layer_getpages }, diff --git a/sys/miscfs/overlay/overlay_vnops.c b/sys/miscfs/overlay/overlay_vnops.c index bd98a5fbed4..7bd404a464d 100644 --- a/sys/miscfs/overlay/overlay_vnops.c +++ b/sys/miscfs/overlay/overlay_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: overlay_vnops.c,v 1.10 2003/08/07 16:32:40 agc Exp $ */ +/* $NetBSD: overlay_vnops.c,v 1.11 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1999, 2000 National Aeronautics & Space Administration @@ -67,7 +67,7 @@ * * Ancestors: * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92 - * $Id: overlay_vnops.c,v 1.10 2003/08/07 16:32:40 agc Exp $ + * $Id: overlay_vnops.c,v 1.11 2004/01/25 18:06:49 hannken Exp $ * ...and... * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project */ @@ -126,7 +126,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: overlay_vnops.c,v 1.10 2003/08/07 16:32:40 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: overlay_vnops.c,v 1.11 2004/01/25 18:06:49 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -162,7 +162,6 @@ const struct vnodeopv_entry_desc overlay_vnodeop_entries[] = { { &vop_open_desc, layer_open }, /* mount option handling */ - { &vop_strategy_desc, layer_strategy }, { &vop_bwrite_desc, layer_bwrite }, { &vop_bmap_desc, layer_bmap }, { &vop_getpages_desc, layer_getpages }, diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 2f395a6899a..1fcc96bebca 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: spec_vnops.c,v 1.75 2003/12/10 11:40:12 hannken Exp $ */ +/* $NetBSD: spec_vnops.c,v 1.76 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1989, 1993 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.75 2003/12/10 11:40:12 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.76 2004/01/25 18:06:49 hannken Exp $"); #include "fss.h" @@ -583,22 +583,21 @@ spec_strategy(v) void *v; { struct vop_strategy_args /* { + struct vnode *a_vp; struct buf *a_bp; } */ *ap = v; - struct buf *bp; - const struct bdevsw *bdev; + struct vnode *vp = ap->a_vp; + struct buf *bp = ap->a_bp; - bp = ap->a_bp; + bp->b_dev = vp->v_rdev; if (!(bp->b_flags & B_READ) && (LIST_FIRST(&bp->b_dep)) != NULL && bioops.io_start) (*bioops.io_start)(bp); - bdev = bdevsw_lookup(bp->b_dev); - if (bdev != NULL) { #if NFSS > 0 - fss_cow_hook(bp); + fss_cow_hook(bp); #endif - (*bdev->d_strategy)(bp); - } + DEV_STRATEGY(bp); + return (0); } diff --git a/sys/miscfs/umapfs/umap_vnops.c b/sys/miscfs/umapfs/umap_vnops.c index 80ac1f27f4e..df85a23f72b 100644 --- a/sys/miscfs/umapfs/umap_vnops.c +++ b/sys/miscfs/umapfs/umap_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: umap_vnops.c,v 1.23 2003/08/07 16:32:46 agc Exp $ */ +/* $NetBSD: umap_vnops.c,v 1.24 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1992, 1993 @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: umap_vnops.c,v 1.23 2003/08/07 16:32:46 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umap_vnops.c,v 1.24 2004/01/25 18:06:49 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -85,7 +85,6 @@ const struct vnodeopv_entry_desc umap_vnodeop_entries[] = { { &vop_setattr_desc, layer_setattr }, { &vop_access_desc, layer_access }, - { &vop_strategy_desc, layer_strategy }, { &vop_bwrite_desc, layer_bwrite }, { &vop_bmap_desc, layer_bmap }, { &vop_getpages_desc, layer_getpages }, diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 73676a1a3f2..8848181c355 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -1,4 +1,4 @@ -/* $NetBSD: buf.h,v 1.70 2004/01/10 14:49:44 yamt Exp $ */ +/* $NetBSD: buf.h,v 1.71 2004/01/25 18:06:49 hannken Exp $ */ /*- * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. @@ -199,6 +199,7 @@ struct buf { do { \ LIST_INIT(&(bp)->b_dep); \ simple_lock_init(&(bp)->b_interlock); \ + (bp)->b_dev = NODEV; \ BIO_SETPRIO((bp), BPRIO_DEFAULT); \ } while (/*CONSTCOND*/0) diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 1c530c73a5e..6b9fc575486 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -1,4 +1,4 @@ -/* $NetBSD: conf.h,v 1.114 2003/10/16 12:02:58 jdolecek Exp $ */ +/* $NetBSD: conf.h,v 1.115 2004/01/25 18:06:49 hannken Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -89,6 +89,14 @@ struct cdevsw { #ifdef _KERNEL +#define DEV_STRATEGY(bp) \ + do { \ + const struct bdevsw *bdev = bdevsw_lookup((bp)->b_dev); \ + if (bdev == NULL) \ + panic("DEV_STRATEGY: block device not found"); \ + (*bdev->d_strategy)((bp)); \ + } while (/*CONSTCOND*/0) + int devsw_attach(const char *, const struct bdevsw *, int *, const struct cdevsw *, int *); void devsw_detach(const struct bdevsw *, const struct cdevsw *); diff --git a/sys/sys/vnode_if.h b/sys/sys/vnode_if.h index bb96fea9b70..a07c0c7cd99 100644 --- a/sys/sys/vnode_if.h +++ b/sys/sys/vnode_if.h @@ -1,13 +1,13 @@ -/* $NetBSD: vnode_if.h,v 1.44 2003/08/07 16:34:23 agc Exp $ */ +/* $NetBSD: vnode_if.h,v 1.45 2004/01/25 18:06:49 hannken Exp $ */ /* * Warning: This file is generated automatically. * (Modifications made here may easily be lost!) * * Created from the file: - * NetBSD: vnode_if.src,v 1.33 2003/04/10 20:35:36 jdolecek Exp + * NetBSD: vnode_if.src,v 1.38 2004/01/25 18:02:04 hannken Exp * by the script: - * NetBSD: vnode_if.sh,v 1.30 2001/11/12 14:34:24 lukem Exp + * NetBSD: vnode_if.sh,v 1.34 2004/01/25 18:02:04 hannken Exp */ /* @@ -1095,6 +1095,33 @@ static __inline int VOP_BMAP(vp, bn, vpp, bnp, runp) } #endif +struct vop_strategy_args { + const struct vnodeop_desc *a_desc; + struct vnode *a_vp; + struct buf *a_bp; +}; +extern const struct vnodeop_desc vop_strategy_desc; +#ifndef VNODE_OP_NOINLINE +static __inline +#endif +int VOP_STRATEGY(struct vnode *, struct buf *) +#ifndef VNODE_OP_NOINLINE +__attribute__((__unused__)) +#endif +; +#ifndef VNODE_OP_NOINLINE +static __inline int VOP_STRATEGY(vp, bp) + struct vnode *vp; + struct buf *bp; +{ + struct vop_strategy_args a; + a.a_desc = VDESC(vop_strategy); + a.a_vp = vp; + a.a_bp = bp; + return (VCALL(vp, VOFFSET(vop_strategy), &a)); +} +#endif + struct vop_print_args { const struct vnodeop_desc *a_desc; struct vnode *a_vp; @@ -1585,30 +1612,6 @@ static __inline int VOP_PUTPAGES(vp, offlo, offhi, flags) /* Special cases: */ #include <sys/buf.h> -struct vop_strategy_args { - const struct vnodeop_desc *a_desc; - struct buf *a_bp; -}; -extern const struct vnodeop_desc vop_strategy_desc; -#ifndef VNODE_OP_NOINLINE -static __inline -#endif -int VOP_STRATEGY(struct buf *) -#ifndef VNODE_OP_NOINLINE -__attribute__((__unused__)) -#endif -; -#ifndef VNODE_OP_NOINLINE -static __inline int VOP_STRATEGY(bp) - struct buf *bp; -{ - struct vop_strategy_args a; - a.a_desc = VDESC(vop_strategy); - a.a_bp = bp; - return (VCALL(bp->b_vp, VOFFSET(vop_strategy), &a)); -} -#endif - struct vop_bwrite_args { const struct vnodeop_desc *a_desc; struct buf *a_bp; diff --git a/sys/ufs/ext2fs/ext2fs_bmap.c b/sys/ufs/ext2fs/ext2fs_bmap.c index d5b1358764d..6acda034e26 100644 --- a/sys/ufs/ext2fs/ext2fs_bmap.c +++ b/sys/ufs/ext2fs/ext2fs_bmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs_bmap.c,v 1.13 2003/10/05 17:48:49 bouyer Exp $ */ +/* $NetBSD: ext2fs_bmap.c,v 1.14 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1989, 1991, 1993 @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ext2fs_bmap.c,v 1.13 2003/10/05 17:48:49 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ext2fs_bmap.c,v 1.14 2004/01/25 18:06:49 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -237,7 +237,7 @@ ext2fs_bmaparray(vp, bn, bnp, ap, nump, runp) trace(TR_BREADMISS, pack(vp, size), metalbn); bp->b_blkno = blkptrtodb(ump, daddr); bp->b_flags |= B_READ; - VOP_STRATEGY(bp); + VOP_STRATEGY(vp, bp); curproc->p_stats->p_ru.ru_inblock++; /* XXX */ if ((error = biowait(bp)) != 0) { brelse(bp); diff --git a/sys/ufs/ext2fs/ext2fs_inode.c b/sys/ufs/ext2fs/ext2fs_inode.c index f4c7ad7bc5a..eb06a5dd696 100644 --- a/sys/ufs/ext2fs/ext2fs_inode.c +++ b/sys/ufs/ext2fs/ext2fs_inode.c @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs_inode.c,v 1.38 2003/11/05 10:18:38 hannken Exp $ */ +/* $NetBSD: ext2fs_inode.c,v 1.39 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ext2fs_inode.c,v 1.38 2003/11/05 10:18:38 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ext2fs_inode.c,v 1.39 2004/01/25 18:06:49 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -459,7 +459,7 @@ ext2fs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) if (bp->b_bcount > bp->b_bufsize) panic("ext2fs_indirtrunc: bad buffer size"); bp->b_blkno = dbn; - VOP_STRATEGY(bp); + VOP_STRATEGY(vp, bp); error = biowait(bp); } if (error) { diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 1407669226c..7893c474843 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_inode.c,v 1.61 2004/01/10 14:39:51 yamt Exp $ */ +/* $NetBSD: ffs_inode.c,v 1.62 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ffs_inode.c,v 1.61 2004/01/10 14:39:51 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ffs_inode.c,v 1.62 2004/01/25 18:06:49 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_ffs.h" @@ -564,7 +564,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) panic("ffs_indirtrunc: bad buffer size"); bp->b_blkno = dbn; BIO_SETPRIO(bp, BPRIO_TIMECRITICAL); - VOP_STRATEGY(bp); + VOP_STRATEGY(vp, bp); error = biowait(bp); } if (error) { diff --git a/sys/ufs/lfs/lfs_balloc.c b/sys/ufs/lfs/lfs_balloc.c index 65857d3199f..636210fb784 100644 --- a/sys/ufs/lfs/lfs_balloc.c +++ b/sys/ufs/lfs/lfs_balloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_balloc.c,v 1.47 2003/12/30 12:33:24 pk Exp $ */ +/* $NetBSD: lfs_balloc.c,v 1.48 2004/01/25 18:06:49 hannken Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.47 2003/12/30 12:33:24 pk Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.48 2004/01/25 18:06:49 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_quota.h" @@ -267,7 +267,7 @@ lfs_balloc(void *v) } else if (!(ibp->b_flags & (B_DELWRI | B_DONE))) { ibp->b_blkno = fsbtodb(fs, idaddr); ibp->b_flags |= B_READ; - VOP_STRATEGY(ibp); + VOP_STRATEGY(vp, ibp); biowait(ibp); } /* @@ -344,7 +344,7 @@ lfs_balloc(void *v) */ bp->b_blkno = daddr; bp->b_flags |= B_READ; - VOP_STRATEGY(bp); + VOP_STRATEGY(vp, bp); return (biowait(bp)); } } diff --git a/sys/ufs/lfs/lfs_inode.c b/sys/ufs/lfs/lfs_inode.c index c0544dfd93b..d7fd1fb6b3a 100644 --- a/sys/ufs/lfs/lfs_inode.c +++ b/sys/ufs/lfs/lfs_inode.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_inode.c,v 1.81 2003/12/30 12:33:24 pk Exp $ */ +/* $NetBSD: lfs_inode.c,v 1.82 2004/01/25 18:06:49 hannken Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,v 1.81 2003/12/30 12:33:24 pk Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,v 1.82 2004/01/25 18:06:49 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_quota.h" @@ -679,7 +679,7 @@ lfs_indirtrunc(struct inode *ip, daddr_t lbn, daddr_t dbn, if (bp->b_bcount > bp->b_bufsize) panic("lfs_indirtrunc: bad buffer size"); bp->b_blkno = fsbtodb(fs, dbn); - VOP_STRATEGY(bp); + VOP_STRATEGY(vp, bp); error = biowait(bp); } if (error) { diff --git a/sys/ufs/lfs/lfs_segment.c b/sys/ufs/lfs/lfs_segment.c index 1e632bd36e5..7e8ae5ad162 100644 --- a/sys/ufs/lfs/lfs_segment.c +++ b/sys/ufs/lfs/lfs_segment.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_segment.c,v 1.147 2004/01/10 14:39:51 yamt Exp $ */ +/* $NetBSD: lfs_segment.c,v 1.148 2004/01/25 18:06:49 hannken Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.147 2004/01/10 14:39:51 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.148 2004/01/25 18:06:49 hannken Exp $"); #define ivndebug(vp,str) printf("ino %d: %s\n",VTOI(vp)->i_number,(str)) @@ -2008,6 +2008,7 @@ lfs_writeseg(struct lfs *fs, struct segment *sp) V_INCR_NUMOUTPUT(devvp); splx(s); vop_strategy_a.a_desc = VDESC(vop_strategy); + vop_strategy_a.a_vp = cbp->b_vp; vop_strategy_a.a_bp = cbp; (strategy)(&vop_strategy_a); curproc->p_stats->p_ru.ru_oublock++; @@ -2072,6 +2073,7 @@ lfs_writesuper(struct lfs *fs, daddr_t daddr) else BIO_SETPRIO(bp, BPRIO_TIMELIMITED); vop_strategy_a.a_desc = VDESC(vop_strategy); + vop_strategy_a.a_vp = bp->b_vp; vop_strategy_a.a_bp = bp; curproc->p_stats->p_ru.ru_oublock++; s = splbio(); diff --git a/sys/ufs/lfs/lfs_vnops.c b/sys/ufs/lfs/lfs_vnops.c index d0644799275..47e61fd7823 100644 --- a/sys/ufs/lfs/lfs_vnops.c +++ b/sys/ufs/lfs/lfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_vnops.c,v 1.126 2003/12/16 13:47:48 yamt Exp $ */ +/* $NetBSD: lfs_vnops.c,v 1.127 2004/01/25 18:06:49 hannken Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.126 2003/12/16 13:47:48 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.127 2004/01/25 18:06:49 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1101,8 +1101,7 @@ lfs_strategy(void *v) simple_unlock(&fs->lfs_interlock); vp = ip->i_devvp; - bp->b_dev = vp->v_rdev; - VOCALL (vp->v_op, VOFFSET(vop_strategy), ap); + VOP_STRATEGY(vp, bp); return (0); } diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c index d56cbc641d1..84db64119c8 100644 --- a/sys/ufs/ufs/ufs_bmap.c +++ b/sys/ufs/ufs/ufs_bmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_bmap.c,v 1.26 2004/01/10 14:39:51 yamt Exp $ */ +/* $NetBSD: ufs_bmap.c,v 1.27 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1989, 1991, 1993 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ufs_bmap.c,v 1.26 2004/01/10 14:39:51 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ufs_bmap.c,v 1.27 2004/01/25 18:06:49 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -244,7 +244,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, is_sequential) bp->b_blkno = blkptrtodb(ump, daddr); bp->b_flags |= B_READ; BIO_SETPRIO(bp, BPRIO_TIMECRITICAL); - VOP_STRATEGY(bp); + VOP_STRATEGY(vp, bp); curproc->p_stats->p_ru.ru_inblock++; /* XXX */ if ((error = biowait(bp)) != 0) { brelse(bp); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index e5f93674607..2e522340cf7 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_vnops.c,v 1.109 2003/11/08 06:38:10 dbj Exp $ */ +/* $NetBSD: ufs_vnops.c,v 1.110 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993, 1995 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.109 2003/11/08 06:38:10 dbj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.110 2004/01/25 18:06:49 hannken Exp $"); #ifndef _LKM #include "opt_quota.h" @@ -1730,9 +1730,7 @@ ufs_strategy(void *v) return (0); } vp = ip->i_devvp; - bp->b_dev = vp->v_rdev; - VOCALL (vp->v_op, VOFFSET(vop_strategy), ap); - return (0); + return (VOP_STRATEGY(vp, bp)); } /* diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c index 544a68aabaa..9e3534ef18c 100644 --- a/sys/uvm/uvm_swap.c +++ b/sys/uvm/uvm_swap.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_swap.c,v 1.83 2004/01/10 14:39:51 yamt Exp $ */ +/* $NetBSD: uvm_swap.c,v 1.84 2004/01/25 18:06:49 hannken Exp $ */ /* * Copyright (c) 1995, 1996, 1997 Matthew R. Green @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.83 2004/01/10 14:39:51 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.84 2004/01/25 18:06:49 hannken Exp $"); #include "fs_nfs.h" #include "opt_uvmhist.h" @@ -1182,7 +1182,7 @@ swstrategy(bp) */ bp->b_vp = vp; splx(s); - VOP_STRATEGY(bp); + VOP_STRATEGY(vp, bp); return; case VREG: @@ -1376,7 +1376,7 @@ sw_reg_start(sdp) if ((bp->b_flags & B_READ) == 0) V_INCR_NUMOUTPUT(bp->b_vp); - VOP_STRATEGY(bp); + VOP_STRATEGY(bp->b_vp, bp); } sdp->swd_flags &= ~SWF_BUSY; } @@ -1728,7 +1728,6 @@ uvm_swap_io(pps, startslot, npages, flags) bp->b_data = (caddr_t)kva; bp->b_blkno = startblk; bp->b_vp = swapdev_vp; - bp->b_dev = swapdev_vp->v_rdev; bp->b_bufsize = bp->b_bcount = npages << PAGE_SHIFT; /* @@ -1764,7 +1763,7 @@ uvm_swap_io(pps, startslot, npages, flags) * now we start the I/O, and if async, return. */ - VOP_STRATEGY(bp); + VOP_STRATEGY(swapdev_vp, bp); if (async) return 0; |
