diff options
author | dyson <dyson@FreeBSD.org> | 1995-11-19 22:22:35 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1995-11-19 22:22:35 +0000 |
commit | 2621436e462111b2d75fd6843689b60a86318002 (patch) | |
tree | 061a7602ced3c5c9d0ea539fff341a22dceeaeb7 /sys/scsi/sctarg.c | |
parent | 19d6126f96ac43f7aae32fd90e63563935936cb2 (diff) | |
download | FreeBSD-src-2621436e462111b2d75fd6843689b60a86318002.zip FreeBSD-src-2621436e462111b2d75fd6843689b60a86318002.tar.gz |
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.
Diffstat (limited to 'sys/scsi/sctarg.c')
-rw-r--r-- | sys/scsi/sctarg.c | 19 |
1 files changed, 8 insertions, 11 deletions
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 |