summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-08-14 11:40:51 +0000
committerphk <phk@FreeBSD.org>1999-08-14 11:40:51 +0000
commit5f45261e990bb420f6394e615c3495668886dfe9 (patch)
tree66dfc8aa5c9515f4ec0197d4ad3f1c2445413016 /sys/dev
parent5ff2615ae3524707b482556fcc6668d139f2cd67 (diff)
downloadFreeBSD-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')
-rw-r--r--sys/dev/ata/ata-disk.c17
-rw-r--r--sys/dev/ata/atapi-fd.c15
-rw-r--r--sys/dev/ccd/ccd.c8
-rw-r--r--sys/dev/fdc/fdc.c9
-rw-r--r--sys/dev/ida/ida_disk.c10
-rw-r--r--sys/dev/vinum/vinumdaemon.c4
-rw-r--r--sys/dev/vinum/vinuminterrupt.c6
-rw-r--r--sys/dev/vinum/vinumio.c4
-rw-r--r--sys/dev/vinum/vinumrequest.c6
-rw-r--r--sys/dev/vn/vn.c8
10 files changed, 32 insertions, 55 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);
diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c
index 1ebdce2..c6eb299 100644
--- a/sys/dev/ccd/ccd.c
+++ b/sys/dev/ccd/ccd.c
@@ -1,4 +1,4 @@
-/* $Id: ccd.c,v 1.50 1999/07/17 19:58:37 phk Exp $ */
+/* $Id: ccd.c,v 1.51 1999/07/18 14:30:57 phk Exp $ */
/* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */
@@ -1265,7 +1265,7 @@ ccdioctl(dev, cmd, data, flag, p)
if (error == 0) {
if (cmd == DIOCWDINFO)
error = writedisklabel(CCDLABELDEV(dev),
- ccdstrategy, &cs->sc_label);
+ &cs->sc_label);
}
cs->sc_flags &= ~CCDF_LABELLING;
@@ -1435,8 +1435,8 @@ ccdgetdisklabel(dev)
/*
* Call the generic disklabel extraction routine.
*/
- if ((errstring = readdisklabel(CCDLABELDEV(dev), ccdstrategy,
- &cs->sc_label)) != NULL)
+ errstring = readdisklabel(CCDLABELDEV(dev), &cs->sc_label);
+ if (errstring != NULL)
ccdmakedisklabel(cs);
#ifdef DEBUG
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 43b0274..c86bc86 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.150 1999/07/29 01:02:55 mdodd Exp $
+ * $Id: fd.c,v 1.151 1999/07/29 11:27:33 joerg Exp $
*
*/
@@ -2217,7 +2217,7 @@ fdformat(dev, finfo, p)
/* now do the format */
bp->b_dev = dev;
- fdstrategy(bp);
+ BUF_STRATEGY(bp, 0);
/* ...and wait for it to complete */
s = splbio();
@@ -2277,7 +2277,7 @@ fdioctl(dev, cmd, addr, flag, p)
dl->d_secpercyl = fdt->size / fdt->tracks;
dl->d_type = DTYPE_FLOPPY;
- if (readdisklabel(dkmodpart(dev, RAW_PART), fdstrategy, dl)
+ if (readdisklabel(dkmodpart(dev, RAW_PART), dl)
== NULL)
error = 0;
else
@@ -2308,8 +2308,7 @@ fdioctl(dev, cmd, addr, flag, p)
(u_long)0)) != 0)
break;
- error = writedisklabel(dev, fdstrategy,
- (struct disklabel *)buffer);
+ error = writedisklabel(dev, (struct disklabel *)buffer);
break;
case FD_FORM:
if ((flag & FWRITE) == 0)
diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c
index ed52ae2..4564916 100644
--- a/sys/dev/ida/ida_disk.c
+++ b/sys/dev/ida/ida_disk.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ida_disk.c,v 1.1 1999/06/24 03:31:57 jlemon Exp $
+ * $Id: ida_disk.c,v 1.2 1999/07/04 14:58:16 phk Exp $
*/
/*
@@ -144,8 +144,7 @@ idopen(dev_t dev, int flags, int fmt, struct proc *p)
label.d_secperunit = drv->secperunit;
/* Initialize slice tables. */
- error = dsopen("id", dev, fmt, 0, &drv->slices, &label,
- idstrategy, (ds_setgeom_t *)NULL, &id_cdevsw);
+ error = dsopen("id", dev, fmt, 0, &drv->slices, &label);
return (error);
}
@@ -172,8 +171,7 @@ idioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct proc *p)
if (drv == NULL)
return (ENXIO);
- error = dsioctl("id", dev, cmd, addr, flag, &drv->slices,
- idstrategy, (ds_setgeom_t *)NULL);
+ error = dsioctl("id", dev, cmd, addr, flag, &drv->slices);
if (error == ENOIOCTL)
return (ENOTTY);
@@ -189,7 +187,7 @@ idsize(dev_t dev)
drv = idgetsoftc(dev);
if (drv == NULL)
return (ENXIO);
- return (dssize(dev, &drv->slices, idopen, idclose));
+ return (dssize(dev, &drv->slices));
}
/*
diff --git a/sys/dev/vinum/vinumdaemon.c b/sys/dev/vinum/vinumdaemon.c
index 2d63c45..98bd23b 100644
--- a/sys/dev/vinum/vinumdaemon.c
+++ b/sys/dev/vinum/vinumdaemon.c
@@ -34,7 +34,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumdaemon.c,v 1.5 1999/06/23 03:22:01 grog Exp grog $
+ * $Id: vinumdaemon.c,v 1.11 1999/08/07 08:06:05 grog Exp $
*/
#include <dev/vinum/vinumhdr.h>
@@ -183,7 +183,7 @@ vinum_daemon(void)
void
recover_io(struct request *rq)
{
- vinumstrategy(rq->bp); /* reissue the command */
+ BUF_STRATEGY(rq->bp, 0); /* reissue the command */
}
/* Functions called to interface with the daemon */
diff --git a/sys/dev/vinum/vinuminterrupt.c b/sys/dev/vinum/vinuminterrupt.c
index c132d26..fcaa168 100644
--- a/sys/dev/vinum/vinuminterrupt.c
+++ b/sys/dev/vinum/vinuminterrupt.c
@@ -39,7 +39,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinuminterrupt.c,v 1.6 1999/06/18 00:50:53 grog Exp grog $
+ * $Id: vinuminterrupt.c,v 1.15 1999/08/14 06:25:52 grog Exp $
*/
#include <dev/vinum/vinumhdr.h>
@@ -351,7 +351,7 @@ complete_raid5_write(struct rqelement *rqe)
if (debug & DEBUG_LASTREQS)
logrq(loginfo_raid5_data, (union rqinfou) rqe, bp);
#endif
- (*devsw(rqe->b.b_dev)->d_strategy) (&rqe->b);
+ BUF_STRATEGY(&rqe->b, 0);
}
}
}
@@ -387,5 +387,5 @@ complete_raid5_write(struct rqelement *rqe)
if (debug & DEBUG_LASTREQS)
logrq(loginfo_raid5_parity, (union rqinfou) rqe, bp);
#endif
- (*devsw(rqe->b.b_dev)->d_strategy) (&rqe->b);
+ BUF_STRATEGY(&rqe->b, 0);
}
diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c
index 8e5780f..dab5ae2 100644
--- a/sys/dev/vinum/vinumio.c
+++ b/sys/dev/vinum/vinumio.c
@@ -33,7 +33,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumio.c,v 1.25 1999/06/28 02:37:48 grog Exp grog $
+ * $Id: vinumio.c,v 1.37 1999/08/14 06:26:32 grog Exp $
*/
#include <dev/vinum/vinumhdr.h>
@@ -836,7 +836,7 @@ write_volume_label(int volno)
*dlp = *lp;
bp->b_flags &= ~B_INVAL;
bp->b_flags |= B_WRITE;
- vinumstrategy(bp); /* write it out */
+ BUF_STRATEGY(bp, 0); /* write it out */
error = biowait(bp);
bp->b_flags |= B_INVAL | B_AGE;
brelse(bp);
diff --git a/sys/dev/vinum/vinumrequest.c b/sys/dev/vinum/vinumrequest.c
index 58727a5..6c3a590 100644
--- a/sys/dev/vinum/vinumrequest.c
+++ b/sys/dev/vinum/vinumrequest.c
@@ -37,7 +37,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: vinumrequest.c,v 1.24 1999/07/05 01:53:14 grog Exp grog $
+ * $Id: vinumrequest.c,v 1.32 1999/08/14 06:30:15 grog Exp $
*/
#include <dev/vinum/vinumhdr.h>
@@ -395,7 +395,7 @@ launch_requests(struct request *rq, int reviveok)
logrq(loginfo_rqe, (union rqinfou) rqe, rq->bp);
#endif
/* fire off the request */
- (*devsw(rqe->b.b_dev)->d_strategy) (&rqe->b);
+ BUF_STRATEGY(&rqe->b, 0);
}
}
if (rqg->active) /* we have at least one active request, */
@@ -922,7 +922,7 @@ sdio(struct buf *bp)
sbp->b.b_vp->v_numoutput);
#endif
s = splbio();
- (*devsw(sbp->b.b_dev)->d_strategy) (&sbp->b);
+ BUF_STRATEGY(&sbp->b, 0);
splx(s);
}
diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c
index b45985e..382d4b1 100644
--- a/sys/dev/vn/vn.c
+++ b/sys/dev/vn/vn.c
@@ -38,7 +38,7 @@
* from: Utah Hdr: vn.c 1.13 94/04/02
*
* from: @(#)vn.c 8.6 (Berkeley) 4/1/94
- * $Id: vn.c,v 1.82 1999/08/08 18:42:42 phk Exp $
+ * $Id: vn.c,v 1.83 1999/08/08 22:01:50 phk Exp $
*/
/*
@@ -210,8 +210,7 @@ vnopen(dev_t dev, int flags, int mode, struct proc *p)
label.d_partitions[RAW_PART].p_size = vn->sc_size;
return (dsopen("vn", dev, mode, 0, &vn->sc_slices,
- &label, vnstrategy, (ds_setgeom_t *)NULL,
- &vn_cdevsw));
+ &label));
}
if (dkslice(dev) != WHOLE_DISK_SLICE ||
dkpart(dev) != RAW_PART ||
@@ -362,8 +361,7 @@ vnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
IFOPT(vn,VN_LABELS) {
if (vn->sc_slices != NULL) {
error = dsioctl("vn", dev, cmd, data, flag,
- &vn->sc_slices, vnstrategy,
- (ds_setgeom_t *)NULL);
+ &vn->sc_slices);
if (error != ENOIOCTL)
return (error);
}
OpenPOWER on IntegriCloud