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/dev | |
| 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/dev')
| -rw-r--r-- | sys/dev/ata/ata_raid.c | 7 | ||||
| -rw-r--r-- | sys/dev/ata/ld_ataraid.c | 9 | ||||
| -rw-r--r-- | sys/dev/ccd.c | 8 | ||||
| -rw-r--r-- | sys/dev/cgd.c | 7 | ||||
| -rw-r--r-- | sys/dev/fss.c | 19 | ||||
| -rw-r--r-- | sys/dev/fssvar.h | 3 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 6 | ||||
| -rw-r--r-- | sys/dev/vnd.c | 6 |
8 files changed, 28 insertions, 37 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; } |
