diff options
author | phk <phk@FreeBSD.org> | 2000-04-15 05:54:02 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-04-15 05:54:02 +0000 |
commit | aaaef0b54e307450b19dcd1fb6ec921cc62d1acf (patch) | |
tree | 175dac1aaf0d06b54deb889161091dbcf88c79c6 /sys/cam/scsi/scsi_cd.c | |
parent | f2310ef109eccf99c872f4f90eb70f4fc26e39f1 (diff) | |
download | FreeBSD-src-aaaef0b54e307450b19dcd1fb6ec921cc62d1acf.zip FreeBSD-src-aaaef0b54e307450b19dcd1fb6ec921cc62d1acf.tar.gz |
Complete the bio/buf divorce for all code below devfs::strategy
Exceptions:
Vinum untouched. This means that it cannot be compiled.
Greg Lehey is on the case.
CCD not converted yet, casts to struct buf (still safe)
atapi-cd casts to struct buf to examine B_PHYS
Diffstat (limited to 'sys/cam/scsi/scsi_cd.c')
-rw-r--r-- | sys/cam/scsi/scsi_cd.c | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index 3985570..0ca386a 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -124,7 +124,7 @@ struct cd_softc { cam_pinfo pinfo; cd_state state; volatile cd_flags flags; - struct buf_queue_head buf_queue; + struct bio_queue_head bio_queue; LIST_HEAD(, ccb_hdr) pending_ccbs; struct cd_params params; struct disk disk; @@ -344,7 +344,7 @@ cdoninvalidate(struct cam_periph *periph) { int s; struct cd_softc *softc; - struct buf *q_bp; + struct bio *q_bp; struct ccb_setasync csa; softc = (struct cd_softc *)periph->softc; @@ -374,11 +374,11 @@ cdoninvalidate(struct cam_periph *periph) * XXX Handle any transactions queued to the card * with XPT_ABORT_CCB. */ - while ((q_bp = bufq_first(&softc->buf_queue)) != NULL){ - bufq_remove(&softc->buf_queue, q_bp); - q_bp->b_resid = q_bp->b_bcount; - q_bp->b_error = ENXIO; - q_bp->b_ioflags |= BIO_ERROR; + while ((q_bp = bioq_first(&softc->bio_queue)) != NULL){ + bioq_remove(&softc->bio_queue, q_bp); + q_bp->bio_resid = q_bp->bio_bcount; + q_bp->bio_error = ENXIO; + q_bp->bio_flags |= BIO_ERROR; biodone(q_bp); } splx(s); @@ -575,7 +575,7 @@ cdregister(struct cam_periph *periph, void *arg) bzero(softc, sizeof(*softc)); LIST_INIT(&softc->pending_ccbs); softc->state = CD_STATE_PROBE; - bufq_init(&softc->buf_queue); + bioq_init(&softc->bio_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= CD_FLAG_DISC_REMOVABLE; if ((cgd->inq_data.flags & SID_CmdQue) != 0) @@ -1008,7 +1008,7 @@ cdshorttimeout(void *arg) * Check to see if there is any more pending or outstanding I/O for * this device. If not, move it out of the active slot. */ - if ((bufq_first(&changer->cur_device->buf_queue) == NULL) + if ((bioq_first(&changer->cur_device->bio_queue) == NULL) && (changer->cur_device->device_stats.busy_count == 0)) { changer->flags |= CHANGER_MANUAL_CALL; cdrunchangerqueue(changer); @@ -1135,7 +1135,7 @@ cdrunchangerqueue(void *arg) * to do. If so, requeue it at the end of the queue. If * not, there is no need to requeue it. */ - if (bufq_first(&changer->cur_device->buf_queue) != NULL) { + if (bioq_first(&changer->cur_device->bio_queue) != NULL) { changer->cur_device->pinfo.generation = ++changer->devq.generation; @@ -1217,7 +1217,7 @@ cdchangerschedule(struct cd_softc *softc) softc->flags &= ~CD_FLAG_SCHED_ON_COMP; cdrunchangerqueue(softc->changer); } - } else if ((bufq_first(&softc->buf_queue) == NULL) + } else if ((bioq_first(&softc->bio_queue) == NULL) && (softc->device_stats.busy_count == 0)) { softc->changer->flags |= CHANGER_MANUAL_CALL; cdrunchangerqueue(softc->changer); @@ -1328,18 +1328,18 @@ cdgetccb(struct cam_periph *periph, u_int32_t priority) * only one physical transfer. */ static void -cdstrategy(struct buf *bp) +cdstrategy(struct bio *bp) { struct cam_periph *periph; struct cd_softc *softc; u_int unit, part; int s; - unit = dkunit(bp->b_dev); - part = dkpart(bp->b_dev); + unit = dkunit(bp->bio_dev); + part = dkpart(bp->bio_dev); periph = cam_extend_get(cdperiphs, unit); if (periph == NULL) { - bp->b_error = ENXIO; + bp->bio_error = ENXIO; goto bad; } @@ -1359,14 +1359,14 @@ cdstrategy(struct buf *bp) */ if ((softc->flags & CD_FLAG_INVALID)) { splx(s); - bp->b_error = ENXIO; + bp->bio_error = ENXIO; goto bad; } /* * Place it in the queue of disk activities for this disk */ - bufqdisksort(&softc->buf_queue, bp); + bioqdisksort(&softc->bio_queue, bp); splx(s); @@ -1381,11 +1381,11 @@ cdstrategy(struct buf *bp) return; bad: - bp->b_ioflags |= BIO_ERROR; + bp->bio_flags |= BIO_ERROR; /* * Correctly set the buf to indicate a completed xfer */ - bp->b_resid = bp->b_bcount; + bp->bio_resid = bp->bio_bcount; biodone(bp); return; } @@ -1394,7 +1394,7 @@ static void cdstart(struct cam_periph *periph, union ccb *start_ccb) { struct cd_softc *softc; - struct buf *bp; + struct bio *bp; struct ccb_scsiio *csio; struct scsi_read_capacity_data *rcap; int s; @@ -1409,7 +1409,7 @@ cdstart(struct cam_periph *periph, union ccb *start_ccb) int oldspl; s = splbio(); - bp = bufq_first(&softc->buf_queue); + bp = bioq_first(&softc->bio_queue); if (periph->immediate_priority <= periph->pinfo.priority) { start_ccb->ccb_h.ccb_state = CD_CCB_WAITING; @@ -1422,23 +1422,23 @@ cdstart(struct cam_periph *periph, union ccb *start_ccb) splx(s); xpt_release_ccb(start_ccb); } else { - bufq_remove(&softc->buf_queue, bp); + bioq_remove(&softc->bio_queue, bp); devstat_start_transaction(&softc->device_stats); scsi_read_write(&start_ccb->csio, /*retries*/4, /* cbfcnp */ cddone, - (bp->b_ioflags & BIO_ORDERED) != 0 ? + (bp->bio_flags & BIO_ORDERED) != 0 ? MSG_ORDERED_Q_TAG : MSG_SIMPLE_Q_TAG, - /* read */bp->b_iocmd == BIO_READ, + /* read */bp->bio_cmd == BIO_READ, /* byte2 */ 0, /* minimum_cmd_size */ 10, - /* lba */ bp->b_pblkno, - bp->b_bcount / softc->params.blksize, - /* data_ptr */ bp->b_data, - /* dxfer_len */ bp->b_bcount, + /* lba */ bp->bio_pblkno, + bp->bio_bcount / softc->params.blksize, + /* data_ptr */ bp->bio_data, + /* dxfer_len */ bp->bio_bcount, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 30000); start_ccb->ccb_h.ccb_state = CD_CCB_BUFFER_IO; @@ -1460,7 +1460,7 @@ cdstart(struct cam_periph *periph, union ccb *start_ccb) } start_ccb->ccb_h.ccb_bp = bp; - bp = bufq_first(&softc->buf_queue); + bp = bioq_first(&softc->bio_queue); splx(s); xpt_action(start_ccb); @@ -1513,11 +1513,11 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) switch (csio->ccb_h.ccb_state & CD_CCB_TYPE_MASK) { case CD_CCB_BUFFER_IO: { - struct buf *bp; + struct bio *bp; int error; int oldspl; - bp = (struct buf *)done_ccb->ccb_h.ccb_bp; + bp = (struct bio *)done_ccb->ccb_h.ccb_bp; error = 0; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1542,22 +1542,22 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) if (error != 0) { int s; - struct buf *q_bp; + struct bio *q_bp; xpt_print_path(periph->path); printf("cddone: got error %#x back\n", error); s = splbio(); - while ((q_bp = bufq_first(&softc->buf_queue)) != NULL) { - bufq_remove(&softc->buf_queue, q_bp); - q_bp->b_resid = q_bp->b_bcount; - q_bp->b_error = EIO; - q_bp->b_ioflags |= BIO_ERROR; + while ((q_bp = bioq_first(&softc->bio_queue)) != NULL) { + bioq_remove(&softc->bio_queue, q_bp); + q_bp->bio_resid = q_bp->bio_bcount; + q_bp->bio_error = EIO; + q_bp->bio_flags |= BIO_ERROR; biodone(q_bp); } splx(s); - bp->b_resid = bp->b_bcount; - bp->b_error = error; - bp->b_ioflags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + bp->bio_error = error; + bp->bio_flags |= BIO_ERROR; cam_release_devq(done_ccb->ccb_h.path, /*relsim_flags*/0, /*reduction*/0, @@ -1565,11 +1565,11 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) /*getcount_only*/0); } else { - bp->b_resid = csio->resid; - bp->b_error = 0; - if (bp->b_resid != 0) { + bp->bio_resid = csio->resid; + bp->bio_error = 0; + if (bp->bio_resid != 0) { /* Short transfer ??? */ - bp->b_ioflags |= BIO_ERROR; + bp->bio_flags |= BIO_ERROR; } } @@ -1584,7 +1584,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) if (softc->flags & CD_FLAG_CHANGER) cdchangerschedule(softc); - devstat_end_transaction_buf(&softc->device_stats, bp); + devstat_end_transaction_bio(&softc->device_stats, bp); biodone(bp); break; } |