summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2013-11-20 00:15:33 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2013-11-20 00:15:33 +0000
commit906e98f2eca443fb8de778a1dbf0e460daea8db8 (patch)
tree9bf96477a253077e0cdd74b6416c4163653a679d /sys
parent28b5752fde2e7956453863bfcfe6572b5134f3da (diff)
replace bare use of disksort with bufqs. this is the last disksort user
in the tree apart from the bufq wrapper around it. go ahead miod@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc/dev/xy.c17
-rw-r--r--sys/arch/sparc/dev/xyvar.h4
2 files changed, 8 insertions, 13 deletions
diff --git a/sys/arch/sparc/dev/xy.c b/sys/arch/sparc/dev/xy.c
index ea4838dee00..6bf95635639 100644
--- a/sys/arch/sparc/dev/xy.c
+++ b/sys/arch/sparc/dev/xy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xy.c,v 1.57 2013/11/01 17:36:19 krw Exp $ */
+/* $OpenBSD: xy.c,v 1.58 2013/11/20 00:15:32 dlg Exp $ */
/* $NetBSD: xy.c,v 1.26 1997/07/19 21:43:56 pk Exp $ */
/*
@@ -508,10 +508,7 @@ xyattach(parent, self, aux)
xy->parent = xyc;
/* init queue of waiting bufs */
-
- xy->xyq.b_active = 0;
- xy->xyq.b_actf = 0;
- xy->xyq.b_actb = &xy->xyq.b_actf; /* XXX b_actb: not used? */
+ bufq_init(&xy->xy_bufq, BUFQ_DEFAULT);
xy->xyrq = &xyc->reqs[xa->driveno];
@@ -1003,14 +1000,14 @@ xystrategy(bp)
if (bounds_check_with_label(bp, xy->sc_dk.dk_label) == -1)
goto done;
+ bufq_queue(&xy->xy_bufq, bp);
+
/*
* now we know we have a valid buf structure that we need to do I/O
* on.
*/
s = splbio(); /* protect the queues */
- disksort(&xy->xyq, bp);
-
/* start 'em up */
xyc_start(xy->parent, NULL);
@@ -1604,7 +1601,6 @@ xyc_reset(xycsc, quiet, blastmode, error, xysc)
dvma_mapout((vaddr_t)iorq->dbufbase,
(vaddr_t)iorq->buf->b_data,
iorq->buf->b_bcount);
- iorq->xy->xyq.b_actf = iorq->buf->b_actf;
disk_unbusy(&xycsc->reqs[lcv].xy->sc_dk,
(xycsc->reqs[lcv].buf->b_bcount -
xycsc->reqs[lcv].buf->b_resid),
@@ -1651,9 +1647,9 @@ xyc_start(xycsc, iorq)
if (iorq == NULL) {
for (lcv = 0; lcv < XYC_MAXDEV ; lcv++) {
if ((xy = xycsc->sc_drives[lcv]) == NULL) continue;
- if (xy->xyq.b_actf == NULL) continue;
+ if (!bufq_peek(&xy->xy_bufq)) continue;
if (xy->xyrq->mode != XY_SUB_FREE) continue;
- xyc_startbuf(xycsc, xy, xy->xyq.b_actf);
+ xyc_startbuf(xycsc, xy, bufq_dequeue(&xy->xy_bufq));
}
}
xyc_submit_iorq(xycsc, iorq, XY_SUB_NOQ);
@@ -1783,7 +1779,6 @@ xyc_remove_iorq(xycsc)
dvma_mapout((vaddr_t) iorq->dbufbase,
(vaddr_t) bp->b_data,
bp->b_bcount);
- iorq->xy->xyq.b_actf = bp->b_actf;
disk_unbusy(&iorq->xy->sc_dk,
(bp->b_bcount - bp->b_resid),
(bp->b_flags & B_READ));
diff --git a/sys/arch/sparc/dev/xyvar.h b/sys/arch/sparc/dev/xyvar.h
index 90e1d5a6d7b..2865f4a3a88 100644
--- a/sys/arch/sparc/dev/xyvar.h
+++ b/sys/arch/sparc/dev/xyvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xyvar.h,v 1.7 2011/06/05 18:40:33 matthew Exp $ */
+/* $OpenBSD: xyvar.h,v 1.8 2013/11/20 00:15:32 dlg Exp $ */
/* $NetBSD: xyvar.h,v 1.4 1996/03/31 22:39:04 pk Exp $ */
/*
@@ -115,7 +115,7 @@ struct xy_softc {
u_char nsect; /* number of sectors per track */
u_char hw_spt; /* as above, but includes spare sectors */
struct xy_iorq *xyrq; /* this disk's ioreq structure */
- struct buf xyq; /* queue'd I/O requests */
+ struct bufq xy_bufq; /* queue'd I/O requests */
struct dkbad dkb; /* bad144 sectors */
};