this one is for xy(4) on sparc. again, i cant test, so if anyone
could do that for me it would be appreciated.
does anyone have one of these?
Index: xy.c
===================================================================
RCS file: /cvs/src/sys/arch/sparc/dev/xy.c,v
retrieving revision 1.57
diff -u -p -r1.57 xy.c
--- xy.c 1 Nov 2013 17:36:19 -0000 1.57
+++ xy.c 19 Nov 2013 05:54:05 -0000
@@ -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
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));
Index: xyvar.h
===================================================================
RCS file: /cvs/src/sys/arch/sparc/dev/xyvar.h,v
retrieving revision 1.7
diff -u -p -r1.7 xyvar.h
--- xyvar.h 5 Jun 2011 18:40:33 -0000 1.7
+++ xyvar.h 19 Nov 2013 05:54:05 -0000
@@ -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 */
};