diff options
author | phk <phk@FreeBSD.org> | 1999-08-14 11:40:51 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-08-14 11:40:51 +0000 |
commit | 5f45261e990bb420f6394e615c3495668886dfe9 (patch) | |
tree | 66dfc8aa5c9515f4ec0197d4ad3f1c2445413016 /sys/dev/ata | |
parent | 5ff2615ae3524707b482556fcc6668d139f2cd67 (diff) | |
download | FreeBSD-src-5f45261e990bb420f6394e615c3495668886dfe9.zip FreeBSD-src-5f45261e990bb420f6394e615c3495668886dfe9.tar.gz |
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.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/ata-disk.c | 17 | ||||
-rw-r--r-- | sys/dev/ata/atapi-fd.c | 15 |
2 files changed, 7 insertions, 25 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 532da97..2206642 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ata-disk.c,v 1.15 1999/07/17 17:55:53 phk Exp $ + * $Id: ata-disk.c,v 1.16 1999/08/10 21:59:57 sos Exp $ */ #include "ata.h" @@ -97,7 +97,6 @@ static struct cdevsw fakewd_cdevsw; /* prototypes */ static void ad_attach(void *); static int32_t ad_getparam(struct ad_softc *); -static void ad_strategy(struct buf *); static void ad_start(struct ad_softc *); static void ad_sleep(struct ad_softc *, int8_t *); static int8_t ad_version(u_int16_t); @@ -316,8 +315,7 @@ printf("adopen: lun=%d adnlun=%d\n", lun, adnlun); label.d_secpercyl = adp->sectors * adp->heads; label.d_secperunit = adp->total_secs; - error = dsopen("ad", dev, fmt, 0, &adp->slices, &label, ad_strategy, - (ds_setgeom_t *)NULL, &ad_cdevsw); + error = dsopen("ad", dev, fmt, 0, &adp->slices, &label); adp->flags &= ~AD_F_LABELLING; ad_sleep(adp, "adop2"); @@ -351,8 +349,7 @@ adioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flags, struct proc *p) return ENXIO; ad_sleep(adp, "adioct"); - error = dsioctl("sd", dev, cmd, addr, flags, &adp->slices, - ad_strategy, (ds_setgeom_t *)NULL); + error = dsioctl("sd", dev, cmd, addr, flags, &adp->slices); if (error != ENOIOCTL) return error; @@ -403,7 +400,7 @@ adpsize(dev_t dev) if (lun >= adnlun || !(adp = adtab[lun])) return -1; - return dssize(dev, &adp->slices, adopen, adclose); + return dssize(dev, &adp->slices); } int @@ -477,12 +474,6 @@ addump(dev_t dev) return 0; } -static void -ad_strategy(struct buf *bp) -{ - adstrategy(bp); -} - static void ad_start(struct ad_softc *adp) { diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index 437e8bb..13684b4 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: atapi-fd.c,v 1.10 1999/05/31 11:24:29 phk Exp $ + * $Id: atapi-fd.c,v 1.11 1999/06/25 09:03:05 sos Exp $ */ #include "ata.h" @@ -95,7 +95,6 @@ static int32_t afdnlun = 0; /* number of config'd drives */ int32_t afdattach(struct atapi_softc *); static int32_t afd_sense(struct afd_softc *); static void afd_describe(struct afd_softc *); -static void afd_strategy(struct buf *); static void afd_start(struct afd_softc *); static void afd_partial_done(struct atapi_request *); static void afd_done(struct atapi_request *); @@ -244,8 +243,7 @@ afdopen(dev_t dev, int32_t flags, int32_t fmt, struct proc *p) label.d_secperunit = fdp->cap.heads * fdp->cap.sectors * fdp->cap.cylinders; /* initialize slice tables. */ - return dsopen("afd", dev, fmt, 0, &fdp->slices, &label, afd_strategy, - (ds_setgeom_t *)NULL, &afd_cdevsw); + return dsopen("afd", dev, fmt, 0, &fdp->slices, &label); } static int @@ -273,8 +271,7 @@ afdioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p) if (lun >= afdnlun || !(fdp = afdtab[lun])) return ENXIO; - error = dsioctl("sd", dev, cmd, addr, flag, &fdp->slices, - afd_strategy, (ds_setgeom_t *)NULL); + error = dsioctl("sd", dev, cmd, addr, flag, &fdp->slices); if (error != ENOIOCTL) return error; @@ -318,12 +315,6 @@ afdstrategy(struct buf *bp) } static void -afd_strategy(struct buf *bp) -{ - afdstrategy(bp); -} - -static void afd_start(struct afd_softc *fdp) { struct buf *bp = bufq_first(&fdp->buf_queue); |