From: dlg Date: Sat, 18 Jan 2014 02:42:30 +0000 (+0000) Subject: rename scsi_ioh_runqueue to scsi_iopool_run, and make it available X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f0714dabf12ddd4a964dd985c16b706190169949;p=openbsd rename scsi_ioh_runqueue to scsi_iopool_run, and make it available outside scsi_base.c. this will allow adapters to restrict access to iopool resources based on some state, and then kick the pending requests on the pool when the state comes good again. ive been avoiding this for a long time, but it is the least worst way to deal with some uses of XS_NO_CCB. discussion with kettenis@ helped me decide this was right. --- diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index f0e7f3bce40..32b1331a710 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.208 2013/10/07 17:54:23 miod Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.209 2014/01/18 02:42:30 dlg Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -79,7 +79,6 @@ struct scsi_xfer * scsi_xs_io(struct scsi_link *, void *, int); int scsi_ioh_pending(struct scsi_iopool *); struct scsi_iohandler * scsi_ioh_deq(struct scsi_iopool *); -void scsi_ioh_runqueue(struct scsi_iopool *); void scsi_xsh_runqueue(struct scsi_link *); void scsi_xsh_ioh(void *, void *); @@ -334,7 +333,7 @@ scsi_ioh_add(struct scsi_iohandler *ioh) mtx_leave(&iopl->mtx); /* lets get some io up in the air */ - scsi_ioh_runqueue(iopl); + scsi_iopool_run(iopl); return (rv); } @@ -397,7 +396,7 @@ scsi_ioh_pending(struct scsi_iopool *iopl) } void -scsi_ioh_runqueue(struct scsi_iopool *iopl) +scsi_iopool_run(struct scsi_iopool *iopl) { struct scsi_iohandler *ioh; void *io; @@ -482,7 +481,7 @@ void scsi_io_put(struct scsi_iopool *iopl, void *io) { iopl->io_put(iopl->iocookie, io); - scsi_ioh_runqueue(iopl); + scsi_iopool_run(iopl); } /* @@ -581,7 +580,7 @@ scsi_xsh_runqueue(struct scsi_link *link) mtx_leave(&link->pool->mtx); if (runq) - scsi_ioh_runqueue(link->pool); + scsi_iopool_run(link->pool); } while (!scsi_pending_finish(&link->pool->mtx, &link->running)); } diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index f6c0b7efbe0..7f9ade0f0a6 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.h,v 1.157 2013/09/27 11:43:19 krw Exp $ */ +/* $OpenBSD: scsiconf.h,v 1.158 2014/01/18 02:42:31 dlg Exp $ */ /* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */ /* @@ -541,6 +541,7 @@ void scsi_sense_print_debug(struct scsi_xfer *); */ void scsi_iopool_init(struct scsi_iopool *, void *, void *(*)(void *), void (*)(void *, void *)); +void scsi_iopool_run(struct scsi_iopool *); void scsi_iopool_destroy(struct scsi_iopool *); void scsi_link_shutdown(struct scsi_link *);