diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-09-09 05:43:26 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-09-09 05:43:26 +0000 |
commit | 481a6d3c3ad7f8cce3335683aa939511956a5533 (patch) | |
tree | 0014dc2dda23f978b30f5ec1f02639060eeaab00 /sys/scsi | |
parent | f45d3994453a345bbc2f56bae8f3dac2e67a815f (diff) |
rework the hotplug requests to use tasks rather than workqs.
tested on mpi(4) sas.
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/scsi_base.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 9cf6b450dd3..938d58b25eb 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.214 2014/07/01 02:31:16 dlg Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.215 2014/09/09 05:43:25 dlg Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -45,6 +45,7 @@ #include <sys/device.h> #include <sys/proc.h> #include <sys/pool.h> +#include <sys/task.h> #include <scsi/scsi_all.h> #include <scsi/scsi_disk.h> @@ -66,7 +67,8 @@ struct pool scsi_xfer_pool; struct pool scsi_plug_pool; struct scsi_plug { - struct workq_task wqt; + struct task task; + struct scsibus_softc *sc; int target; int lun; int how; @@ -144,10 +146,12 @@ scsi_req_probe(struct scsibus_softc *sc, int target, int lun) if (p == NULL) return (ENOMEM); + task_set(&p->task, scsi_plug_probe, p, NULL); + p->sc = sc; p->target = target; p->lun = lun; - workq_queue_task(NULL, &p->wqt, 0, scsi_plug_probe, sc, p); + task_add(systq, &p->task); return (0); } @@ -161,20 +165,22 @@ scsi_req_detach(struct scsibus_softc *sc, int target, int lun, int how) if (p == NULL) return (ENOMEM); + task_set(&p->task, scsi_plug_detach, p, NULL); + p->sc = sc; p->target = target; p->lun = lun; p->how = how; - workq_queue_task(NULL, &p->wqt, 0, scsi_plug_detach, sc, p); + task_add(systq, &p->task); return (0); } void -scsi_plug_probe(void *xsc, void *xp) +scsi_plug_probe(void *xp, void *null) { - struct scsibus_softc *sc = xsc; struct scsi_plug *p = xp; + struct scsibus_softc *sc = p->sc; int target = p->target, lun = p->lun; pool_put(&scsi_plug_pool, p); @@ -185,8 +191,8 @@ scsi_plug_probe(void *xsc, void *xp) void scsi_plug_detach(void *xsc, void *xp) { - struct scsibus_softc *sc = xsc; struct scsi_plug *p = xp; + struct scsibus_softc *sc = p->sc; int target = p->target, lun = p->lun; int how = p->how; |