From 2621436e462111b2d75fd6843689b60a86318002 Mon Sep 17 00:00:00 2001 From: dyson Date: Sun, 19 Nov 1995 22:22:35 +0000 Subject: First set of changes to eliminate the ad-hoc device buffer queues, replacing them with TAILQ's as appropriate. The SCSI code is the first to be changed -- until the changes are complete, both b_act and b_actf will be in the buf structure. b_actf will eventually be removed. --- sys/scsi/sctarg.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'sys/scsi/sctarg.c') diff --git a/sys/scsi/sctarg.c b/sys/scsi/sctarg.c index 597c263..e7346a1 100644 --- a/sys/scsi/sctarg.c +++ b/sys/scsi/sctarg.c @@ -37,7 +37,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sctarg.c,v 1.3 1995/05/30 08:13:49 rgrimes Exp $ + * $Id: sctarg.c,v 1.4 1995/07/13 16:08:57 bde Exp $ */ /* @@ -56,7 +56,7 @@ #define OPEN 0x01 struct scsi_data { - struct buf *buf_queue; /* the queue of pending IO operations */ + struct buf_queue_head buf_queue; int flags; /* Already open */ }; @@ -189,10 +189,12 @@ sctargstart(unit, unused_flags) wakeup((caddr_t)sc_link); return; } - if ((bp = sctarg->buf_queue) == NULL) { - return; /* no work to bother with */ + + bp = sctarg->buf_queue.tqh_first; + if (bp == NULL) { /* yes, an assign */ + return; } - sctarg->buf_queue = bp->b_actf; + TAILQ_REMOVE( &pt->buf_queue, bp, b_act); /* * Fill out the scsi command @@ -253,12 +255,7 @@ sctarg_strategy(struct buf *bp, struct scsi_link *sc_link) /* * Place it at the end of the queue of activities for this device. */ - dp = &(sctarg->buf_queue); - while (*dp) { - dp = &((*dp)->b_actf); - } - *dp = bp; - bp->b_actf = NULL; + TAILQ_INSERT_TAIL( &sctarg->buf_queue, bp, b_act); /* * Tell the device to get going on the transfer if it's -- cgit v1.1