diff options
Diffstat (limited to 'sys/dev/ida')
-rw-r--r-- | sys/dev/ida/ida.c | 24 | ||||
-rw-r--r-- | sys/dev/ida/ida_disk.c | 30 | ||||
-rw-r--r-- | sys/dev/ida/idavar.h | 8 |
3 files changed, 31 insertions, 31 deletions
diff --git a/sys/dev/ida/ida.c b/sys/dev/ida/ida.c index 447ed46..2072ab5 100644 --- a/sys/dev/ida/ida.c +++ b/sys/dev/ida/ida.c @@ -190,7 +190,7 @@ ida_init(struct ida_softc *ida) SLIST_INIT(&ida->free_qcbs); STAILQ_INIT(&ida->qcb_queue); - bufq_init(&ida->buf_queue); + bioq_init(&ida->bio_queue); ida->qcbs = (struct ida_qcb *) malloc(IDA_QCB_MAX * sizeof(struct ida_qcb), M_DEVBUF, M_NOWAIT); @@ -358,9 +358,9 @@ ida_command(struct ida_softc *ida, int command, void *data, int datasize, } void -ida_submit_buf(struct ida_softc *ida, struct buf *bp) +ida_submit_buf(struct ida_softc *ida, struct bio *bp) { - bufq_insert_tail(&ida->buf_queue, bp); + bioq_insert_tail(&ida->bio_queue, bp); ida_construct_qcb(ida); ida_start(ida); } @@ -371,9 +371,9 @@ ida_construct_qcb(struct ida_softc *ida) struct ida_hardware_qcb *hwqcb; struct ida_qcb *qcb; bus_dmasync_op_t op; - struct buf *bp; + struct bio *bp; - bp = bufq_first(&ida->buf_queue); + bp = bioq_first(&ida->bio_queue); if (bp == NULL) return; /* no more buffers */ @@ -381,7 +381,7 @@ ida_construct_qcb(struct ida_softc *ida) if (qcb == NULL) return; /* out of resources */ - bufq_remove(&ida->buf_queue, bp); + bioq_remove(&ida->bio_queue, bp); qcb->buf = bp; qcb->flags = 0; @@ -389,7 +389,7 @@ ida_construct_qcb(struct ida_softc *ida) bzero(hwqcb, sizeof(struct ida_hdr) + sizeof(struct ida_req)); bus_dmamap_load(ida->buffer_dmat, qcb->dmamap, - (void *)bp->b_data, bp->b_bcount, ida_setup_dmamap, hwqcb, 0); + (void *)bp->bio_data, bp->bio_bcount, ida_setup_dmamap, hwqcb, 0); op = qcb->flags & DMA_DATA_IN ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE; bus_dmamap_sync(ida->buffer_dmat, qcb->dmamap, op); @@ -398,13 +398,13 @@ ida_construct_qcb(struct ida_softc *ida) * XXX */ { - struct id_softc *drv = (struct id_softc *)bp->b_driver1; + struct id_softc *drv = (struct id_softc *)bp->bio_driver1; hwqcb->hdr.drive = drv->unit; } - hwqcb->req.blkno = bp->b_pblkno; - hwqcb->req.bcount = howmany(bp->b_bcount, DEV_BSIZE); - hwqcb->req.command = bp->b_iocmd == BIO_READ ? CMD_READ : CMD_WRITE; + hwqcb->req.blkno = bp->bio_pblkno; + hwqcb->req.bcount = howmany(bp->bio_bcount, DEV_BSIZE); + hwqcb->req.command = bp->bio_cmd == BIO_READ ? CMD_READ : CMD_WRITE; STAILQ_INSERT_TAIL(&ida->qcb_queue, qcb, link.stqe); } @@ -519,7 +519,7 @@ ida_done(struct ida_softc *ida, struct ida_qcb *qcb) wakeup(qcb); } else { if (error) - qcb->buf->b_ioflags |= BIO_ERROR; + qcb->buf->bio_flags |= BIO_ERROR; id_intr(qcb->buf); } diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c index 3694f62..6f81c0d 100644 --- a/sys/dev/ida/ida_disk.c +++ b/sys/dev/ida/ida_disk.c @@ -149,32 +149,32 @@ idclose(dev_t dev, int flags, int fmt, struct proc *p) * be a multiple of a sector in length. */ static void -idstrategy(struct buf *bp) +idstrategy(struct bio *bp) { struct id_softc *drv; int s; - drv = idgetsoftc(bp->b_dev); + drv = idgetsoftc(bp->bio_dev); if (drv == NULL) { - bp->b_error = EINVAL; + bp->bio_error = EINVAL; goto bad; } /* * software write protect check */ - if (drv->flags & DRV_WRITEPROT && (bp->b_iocmd == BIO_WRITE)) { - bp->b_error = EROFS; + if (drv->flags & DRV_WRITEPROT && (bp->bio_cmd == BIO_WRITE)) { + bp->bio_error = EROFS; goto bad; } /* * If it's a null transfer, return immediately */ - if (bp->b_bcount == 0) + if (bp->bio_bcount == 0) goto done; - bp->b_driver1 = drv; + bp->bio_driver1 = drv; s = splbio(); devstat_start_transaction(&drv->stats); ida_submit_buf(drv->controller, bp); @@ -182,28 +182,28 @@ idstrategy(struct buf *bp) return; bad: - bp->b_ioflags |= BIO_ERROR; + bp->bio_flags |= BIO_ERROR; done: /* * Correctly set the buf to indicate a completed transfer */ - bp->b_resid = bp->b_bcount; + bp->bio_resid = bp->bio_bcount; biodone(bp); return; } void -id_intr(struct buf *bp) +id_intr(struct bio *bp) { - struct id_softc *drv = (struct id_softc *)bp->b_driver1; + struct id_softc *drv = (struct id_softc *)bp->bio_driver1; - if (bp->b_ioflags & BIO_ERROR) - bp->b_error = EIO; + if (bp->bio_flags & BIO_ERROR) + bp->bio_error = EIO; else - bp->b_resid = 0; + bp->bio_resid = 0; - devstat_end_transaction_buf(&drv->stats, bp); + devstat_end_transaction_bio(&drv->stats, bp); biodone(bp); } diff --git a/sys/dev/ida/idavar.h b/sys/dev/ida/idavar.h index c2614ee..50335ab 100644 --- a/sys/dev/ida/idavar.h +++ b/sys/dev/ida/idavar.h @@ -103,7 +103,7 @@ struct ida_qcb { } link; bus_dmamap_t dmamap; bus_addr_t hwqcb_busaddr; - struct buf *buf; /* buf associated with qcb */ + struct bio *buf; /* bio associated with qcb */ }; struct ida_softc; @@ -154,7 +154,7 @@ struct ida_softc { struct ida_qcb *qcbs; /* kernel QCB array */ SLIST_HEAD(, ida_qcb) free_qcbs; STAILQ_HEAD(, ida_qcb) qcb_queue; - struct buf_queue_head buf_queue; + struct bio_queue_head bio_queue; struct ida_access cmd; }; @@ -192,9 +192,9 @@ extern int ida_init(struct ida_softc *ida); extern void ida_attach(struct ida_softc *ida); extern int ida_command(struct ida_softc *ida, int command, void *data, int datasize, int drive, int flags); -extern void ida_submit_buf(struct ida_softc *ida, struct buf *bp); +extern void ida_submit_buf(struct ida_softc *ida, struct bio *bp); extern void ida_intr(void *data); -extern void id_intr(struct buf *bp); +extern void id_intr(struct bio *bp); #endif /* _IDAVAR_H */ |