diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-06-20 18:15:48 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-06-20 18:15:48 +0000 |
commit | 873db335f698dc92ad5bb1724185b94b78cadc90 (patch) | |
tree | 5d88760d74825983a6db073cbf8f2208063bb6cc /sys/arch/hp300 | |
parent | fca02c516c82caf63d1f863db7e8b1b418f4cb66 (diff) |
b_cylinder does not need to be set on the callpath down into drivers.
cpu_disklabel can go away, since nothing anymore needs to use it; ok miod
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r-- | sys/arch/hp300/dev/hd.c | 29 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/disksubr.c | 8 | ||||
-rw-r--r-- | sys/arch/hp300/include/disklabel.h | 5 |
3 files changed, 13 insertions, 29 deletions
diff --git a/sys/arch/hp300/dev/hd.c b/sys/arch/hp300/dev/hd.c index 13abead54f5..63b8e1bdf0c 100644 --- a/sys/arch/hp300/dev/hd.c +++ b/sys/arch/hp300/dev/hd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hd.c,v 1.50 2007/06/08 05:27:58 deraadt Exp $ */ +/* $OpenBSD: hd.c,v 1.51 2007/06/20 18:15:47 deraadt Exp $ */ /* $NetBSD: rd.c,v 1.33 1997/07/10 18:14:08 kleink Exp $ */ /* @@ -237,8 +237,7 @@ int hdident(struct device *, struct hd_softc *, struct hpibbus_attach_args *); void hdreset(int, int, int); void hdustart(struct hd_softc *); -void hdgetdisklabel(dev_t, struct hd_softc *, struct disklabel *, - struct cpu_disklabel *, int); +void hdgetdisklabel(dev_t, struct hd_softc *, struct disklabel *, int); void hdrestart(void *); struct buf *hdfinish(struct hd_softc *, struct buf *); @@ -478,17 +477,15 @@ hdreset(ctlr, slave, punit) * Read or construct a disklabel */ void -hdgetdisklabel(dev, rs, lp, clp, spoofonly) +hdgetdisklabel(dev, rs, lp, spoofonly) dev_t dev; struct hd_softc *rs; struct disklabel *lp; - struct cpu_disklabel *clp; int spoofonly; { char *errstring; bzero(lp, sizeof(struct disklabel)); - bzero(clp, sizeof(struct cpu_disklabel)); /* * Create a default disk label based on geometry. @@ -526,7 +523,7 @@ hdgetdisklabel(dev, rs, lp, clp, spoofonly) /* * Now try to read the disklabel */ - errstring = readdisklabel(DISKLABELDEV(dev), hdstrategy, lp, clp, + errstring = readdisklabel(DISKLABELDEV(dev), hdstrategy, lp, spoofonly); if (errstring) { /* printf("%s: %s\n", rs->sc_dev.dv_xname, errstring); */ @@ -561,8 +558,7 @@ hdopen(dev, flags, mode, p) */ if (rs->sc_dkdev.dk_openmask == 0) { rs->sc_flags |= HDF_OPENING; - hdgetdisklabel(dev, rs, rs->sc_dkdev.dk_label, - rs->sc_dkdev.dk_cpulabel, 0); + hdgetdisklabel(dev, rs, rs->sc_dkdev.dk_label, 0); rs->sc_flags &= ~HDF_OPENING; } @@ -700,7 +696,6 @@ hdstrategy(bp) bp->b_cylinder = bp->b_blkno; } else { if (bounds_check_with_label(bp, rs->sc_dkdev.dk_label, - rs->sc_dkdev.dk_cpulabel, (rs->sc_flags & HDF_WLABEL) != 0) <= 0) goto done; @@ -1150,13 +1145,9 @@ hdioctl(dev, cmd, data, flag, p) if (sc == NULL) return (ENXIO); - switch (cmd) { + switch (cmd) case DIOCGPDINFO: - { - struct cpu_disklabel osdep; - - hdgetdisklabel(dev, sc, (struct disklabel *)data, &osdep, 1); - } + hdgetdisklabel(dev, sc, (struct disklabel *)data, 1); goto exit; case DIOCGDINFO: @@ -1192,13 +1183,11 @@ hdioctl(dev, cmd, data, flag, p) sc->sc_flags |= HDF_WLABEL; error = setdisklabel(sc->sc_dkdev.dk_label, - (struct disklabel *)data, /* sc->sc_dkdev.dk_openmask */ 0, - sc->sc_dkdev.dk_cpulabel); + (struct disklabel *)data, /* sc->sc_dkdev.dk_openmask */ 0); if (error == 0) { if (cmd == DIOCWDINFO) error = writedisklabel(DISKLABELDEV(dev), - hdstrategy, sc->sc_dkdev.dk_label, - sc->sc_dkdev.dk_cpulabel); + hdstrategy, sc->sc_dkdev.dk_label); } sc->sc_flags &= ~HDF_WLABEL; diff --git a/sys/arch/hp300/hp300/disksubr.c b/sys/arch/hp300/hp300/disksubr.c index a83996d1459..4c05c27c341 100644 --- a/sys/arch/hp300/hp300/disksubr.c +++ b/sys/arch/hp300/hp300/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.40 2007/06/17 00:27:28 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.41 2007/06/20 18:15:45 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.9 1997/04/01 03:12:13 scottr Exp $ */ /* @@ -51,7 +51,7 @@ */ char * readdisklabel(dev_t dev, void (*strat)(struct buf *), - struct disklabel *lp, struct cpu_disklabel *osdep, int spoofonly) + struct disklabel *lp, int spoofonly) { struct buf *bp = NULL; char *msg; @@ -69,7 +69,6 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), bp->b_blkno = LABELSECTOR; bp->b_bcount = lp->d_secsize; bp->b_flags = B_BUSY | B_READ; - bp->b_cylinder = LABELSECTOR / lp->d_secpercyl; (*strat)(bp); if (biowait(bp)) { msg = "disk label I/O error"; @@ -105,8 +104,7 @@ done: * Write disk label back to device after modification. */ int -writedisklabel(dev_t dev, void (*strat)(struct buf *), - struct disklabel *lp, struct cpu_disklabel *osdep) +writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) { struct buf *bp = NULL; struct disklabel *dlp; diff --git a/sys/arch/hp300/include/disklabel.h b/sys/arch/hp300/include/disklabel.h index 4554198550c..29c598bccf1 100644 --- a/sys/arch/hp300/include/disklabel.h +++ b/sys/arch/hp300/include/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.7 2007/06/18 17:11:52 deraadt Exp $ */ +/* $OpenBSD: disklabel.h,v 1.8 2007/06/20 18:15:45 deraadt Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -37,7 +37,4 @@ #define LABELOFFSET 0 /* offset of label in sector */ #define MAXPARTITIONS 16 /* number of partitions */ -struct cpu_disklabel { -}; - #endif /* _MACHINE_DISKLABEL_H_ */ |