From 5f45261e990bb420f6394e615c3495668886dfe9 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 14 Aug 1999 11:40:51 +0000 Subject: Spring cleaning around strategy and disklabels/slices: Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout. please see comment in sys/conf.h about the flag argument. Remove strategy argument from all the diskslice/label/bad144 implementations, it should be found from the dev_t. Remove bogus and unused strategy1 routines. Remove open/close arguments from dssize(). Pick them up from dev_t. Remove unused and unfinished setgeom support from diskslice/label/bad144 code. --- sys/cam/scsi/scsi_cd.c | 19 +++---------------- sys/cam/scsi/scsi_da.c | 11 ++++------- 2 files changed, 7 insertions(+), 23 deletions(-) (limited to 'sys/cam') diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index fe353e4..f57ef1a 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_cd.c,v 1.22 1999/05/30 16:51:00 phk Exp $ + * $Id: scsi_cd.c,v 1.23 1999/05/31 11:23:58 phk Exp $ */ /* * Portions of this driver taken from the original FreeBSD cd driver. @@ -180,7 +180,6 @@ static d_open_t cdopen; static d_close_t cdclose; static d_ioctl_t cdioctl; static d_strategy_t cdstrategy; -static d_strategy_t cdstrategy1; static periph_init_t cdinit; static periph_ctor_t cdregister; @@ -958,8 +957,7 @@ cdopen(dev_t dev, int flags, int fmt, struct proc *p) /* Initialize slice tables. */ error = dsopen("cd", dev, fmt, DSO_NOLABELS | DSO_ONESLICE, - &softc->cd_slices, &label, cdstrategy1, - (ds_setgeom_t *)NULL, &cd_cdevsw); + &softc->cd_slices, &label); if (error == 0) { /* @@ -1431,16 +1429,6 @@ done: } static void -cdstrategy1(struct buf *bp) -{ - /* - * XXX - do something to make cdstrategy() but not this block while - * we're doing dsopen() and dsioctl(). - */ - cdstrategy(bp); -} - -static void cdstart(struct cam_periph *periph, union ccb *start_ccb) { struct cd_softc *softc; @@ -2464,8 +2452,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) * Check to see whether we've got a disk-type ioctl. If we * don't, dsioctl will pass back an error code of ENOIOCTL. */ - error = dsioctl("cd", dev, cmd, addr, flag, &softc->cd_slices, - cdstrategy1, (ds_setgeom_t *)NULL); + error = dsioctl("cd", dev, cmd, addr, flag, &softc->cd_slices); if (error != ENOIOCTL) break; diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 71c15f7..ca36b3c 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_da.c,v 1.30 1999/07/07 18:14:01 mjacob Exp $ + * $Id: scsi_da.c,v 1.31 1999/08/09 10:34:30 phk Exp $ */ #include "opt_hw_wdog.h" @@ -379,9 +379,7 @@ daopen(dev_t dev, int flags, int fmt, struct proc *p) } /* Initialize slice tables. */ - error = dsopen("da", dev, fmt, 0, &softc->dk_slices, &label, - dastrategy, (ds_setgeom_t *)NULL, - &da_cdevsw); + error = dsopen("da", dev, fmt, 0, &softc->dk_slices, &label); /* * Check to see whether or not the blocksize is set yet. @@ -600,8 +598,7 @@ daioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) return (error); /* error code from tsleep */ } - error = dsioctl("da", dev, cmd, addr, flag, &softc->dk_slices, - dastrategy, (ds_setgeom_t *)NULL); + error = dsioctl("da", dev, cmd, addr, flag, &softc->dk_slices); if (error == ENOIOCTL) error = cam_periph_ioctl(periph, cmd, addr, daerror); @@ -775,7 +772,7 @@ dasize(dev_t dev) softc = (struct da_softc *)periph->softc; - return (dssize(dev, &softc->dk_slices, daopen, daclose)); + return (dssize(dev, &softc->dk_slices)); } static void -- cgit v1.1