summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_cd.c90
-rw-r--r--sys/cam/scsi/scsi_da.c88
-rw-r--r--sys/cam/scsi/scsi_pass.c60
-rw-r--r--sys/cam/scsi/scsi_pt.c82
-rw-r--r--sys/cam/scsi/scsi_sa.c138
-rw-r--r--sys/cam/scsi/scsi_target.c104
6 files changed, 281 insertions, 281 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;
}
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 9208154..53ce964 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -99,7 +99,7 @@ struct disk_params {
};
struct da_softc {
- struct buf_queue_head buf_queue;
+ struct bio_queue_head bio_queue;
struct devstat device_stats;
SLIST_ENTRY(da_softc) links;
LIST_HEAD(, ccb_hdr) pending_ccbs;
@@ -481,7 +481,7 @@ daclose(dev_t dev, int flag, int fmt, struct proc *p)
* only one physical transfer.
*/
static void
-dastrategy(struct buf *bp)
+dastrategy(struct bio *bp)
{
struct cam_periph *periph;
struct da_softc *softc;
@@ -489,11 +489,11 @@ dastrategy(struct buf *bp)
u_int 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(daperiphs, unit);
if (periph == NULL) {
- bp->b_error = ENXIO;
+ bp->bio_error = ENXIO;
goto bad;
}
softc = (struct da_softc *)periph->softc;
@@ -516,14 +516,14 @@ dastrategy(struct buf *bp)
*/
if ((softc->flags & DA_FLAG_PACK_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);
@@ -534,12 +534,12 @@ dastrategy(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;
}
@@ -772,7 +772,7 @@ daoninvalidate(struct cam_periph *periph)
{
int s;
struct da_softc *softc;
- struct buf *q_bp;
+ struct bio *q_bp;
struct ccb_setasync csa;
softc = (struct da_softc *)periph->softc;
@@ -802,11 +802,11 @@ daoninvalidate(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);
@@ -924,7 +924,7 @@ daregister(struct cam_periph *periph, void *arg)
bzero(softc, sizeof(*softc));
LIST_INIT(&softc->pending_ccbs);
softc->state = DA_STATE_PROBE;
- bufq_init(&softc->buf_queue);
+ bioq_init(&softc->bio_queue);
if (SID_IS_REMOVABLE(&cgd->inq_data))
softc->flags |= DA_FLAG_PACK_REMOVABLE;
if ((cgd->inq_data.flags & SID_CmdQue) != 0)
@@ -1016,14 +1016,14 @@ dastart(struct cam_periph *periph, union ccb *start_ccb)
case DA_STATE_NORMAL:
{
/* Pull a buffer from the queue and get going on it */
- struct buf *bp;
+ struct bio *bp;
int s;
/*
* See if there is a buf with work for us to do..
*/
s = splbio();
- bp = bufq_first(&softc->buf_queue);
+ bp = bioq_first(&softc->bio_queue);
if (periph->immediate_priority <= periph->pinfo.priority) {
CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("queuing for immediate ccb\n"));
@@ -1040,11 +1040,11 @@ dastart(struct cam_periph *periph, union ccb *start_ccb)
int oldspl;
u_int8_t tag_code;
- bufq_remove(&softc->buf_queue, bp);
+ bioq_remove(&softc->bio_queue, bp);
devstat_start_transaction(&softc->device_stats);
- if ((bp->b_ioflags & BIO_ORDERED) != 0
+ if ((bp->bio_flags & BIO_ORDERED) != 0
|| (softc->flags & DA_FLAG_NEED_OTAG) != 0) {
softc->flags &= ~DA_FLAG_NEED_OTAG;
softc->ordered_tag_count++;
@@ -1056,13 +1056,13 @@ dastart(struct cam_periph *periph, union ccb *start_ccb)
/*retries*/4,
dadone,
tag_code,
- bp->b_iocmd == BIO_READ,
+ bp->bio_cmd == BIO_READ,
/*byte2*/0,
softc->minimum_cmd_size,
- bp->b_pblkno,
- bp->b_bcount / softc->params.secsize,
- bp->b_data,
- bp->b_bcount,
+ bp->bio_pblkno,
+ bp->bio_bcount / softc->params.secsize,
+ bp->bio_data,
+ bp->bio_bcount,
/*sense_len*/SSD_FULL_SIZE,
DA_DEFAULT_TIMEOUT * 1000);
start_ccb->ccb_h.ccb_state = DA_CCB_BUFFER_IO;
@@ -1083,7 +1083,7 @@ dastart(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);
@@ -1136,10 +1136,10 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) {
case DA_CCB_BUFFER_IO:
{
- struct buf *bp;
+ struct bio *bp;
int oldspl;
- bp = (struct buf *)done_ccb->ccb_h.ccb_bp;
+ bp = (struct bio *)done_ccb->ccb_h.ccb_bp;
if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
int error;
int s;
@@ -1161,7 +1161,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
return;
}
if (error != 0) {
- struct buf *q_bp;
+ struct bio *q_bp;
s = splbio();
@@ -1183,24 +1183,24 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
* the client can retry these I/Os in the
* proper order should it attempt to recover.
*/
- while ((q_bp = bufq_first(&softc->buf_queue))
+ while ((q_bp = bioq_first(&softc->bio_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;
+ 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_error = error;
- bp->b_resid = bp->b_bcount;
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_error = error;
+ bp->bio_resid = bp->bio_bcount;
+ bp->bio_flags |= BIO_ERROR;
} 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;
}
}
if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
@@ -1210,9 +1210,9 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
/*timeout*/0,
/*getcount_only*/0);
} else {
- bp->b_resid = csio->resid;
+ bp->bio_resid = csio->resid;
if (csio->resid > 0)
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_flags |= BIO_ERROR;
}
/*
@@ -1226,7 +1226,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
if (softc->device_stats.busy_count == 0)
softc->flags |= DA_FLAG_WENT_IDLE;
- devstat_end_transaction_buf(&softc->device_stats, bp);
+ devstat_end_transaction_bio(&softc->device_stats, bp);
biodone(bp);
break;
}
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index c7cc2cc..32a395e 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -75,7 +75,7 @@ struct pass_softc {
pass_state state;
pass_flags flags;
u_int8_t pd_type;
- struct buf_queue_head buf_queue;
+ struct bio_queue_head bio_queue;
union ccb saved_ccb;
struct devstat device_stats;
dev_t dev;
@@ -180,7 +180,7 @@ passoninvalidate(struct cam_periph *periph)
{
int s;
struct pass_softc *softc;
- struct buf *q_bp;
+ struct bio *q_bp;
struct ccb_setasync csa;
softc = (struct pass_softc *)periph->softc;
@@ -210,11 +210,11 @@ passoninvalidate(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);
@@ -315,7 +315,7 @@ passregister(struct cam_periph *periph, void *arg)
bzero(softc, sizeof(*softc));
softc->state = PASS_STATE_NORMAL;
softc->pd_type = SID_TYPE(&cgd->inq_data);
- bufq_init(&softc->buf_queue);
+ bioq_init(&softc->bio_queue);
periph->softc = softc;
@@ -459,7 +459,7 @@ passclose(dev_t dev, int flag, int fmt, struct proc *p)
* only one physical transfer.
*/
static void
-passstrategy(struct buf *bp)
+passstrategy(struct bio *bp)
{
struct cam_periph *periph;
struct pass_softc *softc;
@@ -471,16 +471,16 @@ passstrategy(struct buf *bp)
* really work right now. So, we just pass back EINVAL to tell the
* user to go away.
*/
- bp->b_error = EINVAL;
+ bp->bio_error = EINVAL;
goto bad;
- /* unit = dkunit(bp->b_dev); */
+ /* unit = dkunit(bp->bio_dev); */
/* XXX KDM fix this */
- unit = minor(bp->b_dev) & 0xff;
+ unit = minor(bp->bio_dev) & 0xff;
periph = cam_extend_get(passperiphs, unit);
if (periph == NULL) {
- bp->b_error = ENXIO;
+ bp->bio_error = ENXIO;
goto bad;
}
softc = (struct pass_softc *)periph->softc;
@@ -489,8 +489,8 @@ passstrategy(struct buf *bp)
* Odd number of bytes or negative offset
*/
/* valid request? */
- if (bp->b_blkno < 0) {
- bp->b_error = EINVAL;
+ if (bp->bio_blkno < 0) {
+ bp->bio_error = EINVAL;
goto bad;
}
@@ -501,7 +501,7 @@ passstrategy(struct buf *bp)
*/
s = splbio();
- bufq_insert_tail(&softc->buf_queue, bp);
+ bioq_insert_tail(&softc->bio_queue, bp);
splx(s);
@@ -512,12 +512,12 @@ passstrategy(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;
}
@@ -533,10 +533,10 @@ passstart(struct cam_periph *periph, union ccb *start_ccb)
switch (softc->state) {
case PASS_STATE_NORMAL:
{
- struct buf *bp;
+ struct bio *bp;
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_type = PASS_CCB_WAITING;
SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h,
@@ -549,7 +549,7 @@ passstart(struct cam_periph *periph, union ccb *start_ccb)
xpt_release_ccb(start_ccb);
} else {
- bufq_remove(&softc->buf_queue, bp);
+ bioq_remove(&softc->bio_queue, bp);
devstat_start_transaction(&softc->device_stats);
@@ -561,11 +561,11 @@ passstart(struct cam_periph *periph, union ccb *start_ccb)
* For now, just biodone it with EIO so we don't
* hang.
*/
- bp->b_error = EIO;
- bp->b_ioflags |= BIO_ERROR;
- bp->b_resid = bp->b_bcount;
+ bp->bio_error = EIO;
+ bp->bio_flags |= BIO_ERROR;
+ bp->bio_resid = bp->bio_bcount;
biodone(bp);
- bp = bufq_first(&softc->buf_queue);
+ bp = bioq_first(&softc->bio_queue);
splx(s);
xpt_action(start_ccb);
@@ -590,14 +590,14 @@ passdone(struct cam_periph *periph, union ccb *done_ccb)
switch (csio->ccb_h.ccb_type) {
case PASS_CCB_BUFFER_IO:
{
- struct buf *bp;
+ struct bio *bp;
cam_status status;
u_int8_t scsi_status;
devstat_trans_flags ds_flags;
status = done_ccb->ccb_h.status;
scsi_status = done_ccb->csio.scsi_status;
- bp = (struct buf *)done_ccb->ccb_h.ccb_bp;
+ bp = (struct bio *)done_ccb->ccb_h.ccb_bp;
/* XXX handle errors */
if (!(((status & CAM_STATUS_MASK) == CAM_REQ_CMP)
&& (scsi_status == SCSI_STATUS_OK))) {
@@ -615,8 +615,8 @@ passdone(struct cam_periph *periph, union ccb *done_ccb)
* XXX unfreeze the queue after we complete
* the abort process
*/
- bp->b_error = error;
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_error = error;
+ bp->bio_flags |= BIO_ERROR;
}
if ((done_ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN)
@@ -626,7 +626,7 @@ passdone(struct cam_periph *periph, union ccb *done_ccb)
else
ds_flags = DEVSTAT_NO_DATA;
- devstat_end_transaction_buf(&softc->device_stats, bp);
+ devstat_end_transaction_bio(&softc->device_stats, bp);
biodone(bp);
break;
}
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index cd4e98c..2f6e4db 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -76,7 +76,7 @@ typedef enum {
#define ccb_bp ppriv_ptr1
struct pt_softc {
- struct buf_queue_head buf_queue;
+ struct bio_queue_head bio_queue;
struct devstat device_stats;
LIST_HEAD(, ccb_hdr) pending_ccbs;
pt_state state;
@@ -215,17 +215,17 @@ ptclose(dev_t dev, int flag, int fmt, struct proc *p)
* only one physical transfer.
*/
static void
-ptstrategy(struct buf *bp)
+ptstrategy(struct bio *bp)
{
struct cam_periph *periph;
struct pt_softc *softc;
u_int unit;
int s;
- unit = minor(bp->b_dev);
+ unit = minor(bp->bio_dev);
periph = cam_extend_get(ptperiphs, unit);
if (periph == NULL) {
- bp->b_error = ENXIO;
+ bp->bio_error = ENXIO;
goto bad;
}
softc = (struct pt_softc *)periph->softc;
@@ -242,14 +242,14 @@ ptstrategy(struct buf *bp)
*/
if ((softc->flags & PT_FLAG_DEVICE_INVALID)) {
splx(s);
- bp->b_error = ENXIO;
+ bp->bio_error = ENXIO;
goto bad;
}
/*
* Place it in the queue of disk activities for this disk
*/
- bufq_insert_tail(&softc->buf_queue, bp);
+ bioq_insert_tail(&softc->bio_queue, bp);
splx(s);
@@ -260,12 +260,12 @@ ptstrategy(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);
}
@@ -339,7 +339,7 @@ ptctor(struct cam_periph *periph, void *arg)
bzero(softc, sizeof(*softc));
LIST_INIT(&softc->pending_ccbs);
softc->state = PT_STATE_NORMAL;
- bufq_init(&softc->buf_queue);
+ bioq_init(&softc->bio_queue);
softc->io_timeout = SCSI_PT_DEFAULT_TIMEOUT * 1000;
@@ -382,7 +382,7 @@ ptoninvalidate(struct cam_periph *periph)
{
int s;
struct pt_softc *softc;
- struct buf *q_bp;
+ struct bio *q_bp;
struct ccb_setasync csa;
softc = (struct pt_softc *)periph->softc;
@@ -412,11 +412,11 @@ ptoninvalidate(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);
}
@@ -506,7 +506,7 @@ static void
ptstart(struct cam_periph *periph, union ccb *start_ccb)
{
struct pt_softc *softc;
- struct buf *bp;
+ struct bio *bp;
int s;
softc = (struct pt_softc *)periph->softc;
@@ -515,7 +515,7 @@ ptstart(struct cam_periph *periph, union ccb *start_ccb)
* See if there is a buf with work for us to do..
*/
s = splbio();
- bp = bufq_first(&softc->buf_queue);
+ bp = bioq_first(&softc->bio_queue);
if (periph->immediate_priority <= periph->pinfo.priority) {
CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("queuing for immediate ccb\n"));
@@ -531,7 +531,7 @@ ptstart(struct cam_periph *periph, union ccb *start_ccb)
} else {
int oldspl;
- bufq_remove(&softc->buf_queue, bp);
+ bioq_remove(&softc->bio_queue, bp);
devstat_start_transaction(&softc->device_stats);
@@ -539,10 +539,10 @@ ptstart(struct cam_periph *periph, union ccb *start_ccb)
/*retries*/4,
ptdone,
MSG_SIMPLE_Q_TAG,
- bp->b_iocmd == BIO_READ,
+ bp->bio_cmd == BIO_READ,
/*byte2*/0,
- bp->b_bcount,
- bp->b_data,
+ bp->bio_bcount,
+ bp->bio_data,
/*sense_len*/SSD_FULL_SIZE,
/*timeout*/softc->io_timeout);
@@ -558,7 +558,7 @@ ptstart(struct cam_periph *periph, union ccb *start_ccb)
splx(oldspl);
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);
@@ -582,10 +582,10 @@ ptdone(struct cam_periph *periph, union ccb *done_ccb)
case PT_CCB_BUFFER_IO:
case PT_CCB_BUFFER_IO_UA:
{
- struct buf *bp;
+ struct bio *bp;
int oldspl;
- bp = (struct buf *)done_ccb->ccb_h.ccb_bp;
+ bp = (struct bio *)done_ccb->ccb_h.ccb_bp;
if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
int error;
int s;
@@ -606,7 +606,7 @@ ptdone(struct cam_periph *periph, union ccb *done_ccb)
return;
}
if (error != 0) {
- struct buf *q_bp;
+ struct bio *q_bp;
s = splbio();
@@ -625,24 +625,24 @@ ptdone(struct cam_periph *periph, union ccb *done_ccb)
* the client can retry these I/Os in the
* proper order should it attempt to recover.
*/
- while ((q_bp = bufq_first(&softc->buf_queue))
+ while ((q_bp = bioq_first(&softc->bio_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;
+ 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_error = error;
- bp->b_resid = bp->b_bcount;
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_error = error;
+ bp->bio_resid = bp->bio_bcount;
+ bp->bio_flags |= BIO_ERROR;
} 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;
}
}
if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
@@ -652,9 +652,9 @@ ptdone(struct cam_periph *periph, union ccb *done_ccb)
/*timeout*/0,
/*getcount_only*/0);
} else {
- bp->b_resid = csio->resid;
- if (bp->b_resid != 0)
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_resid = csio->resid;
+ if (bp->bio_resid != 0)
+ bp->bio_flags |= BIO_ERROR;
}
/*
@@ -665,7 +665,7 @@ ptdone(struct cam_periph *periph, union ccb *done_ccb)
LIST_REMOVE(&done_ccb->ccb_h, periph_links.le);
splx(oldspl);
- devstat_end_transaction_buf(&softc->device_stats, bp);
+ devstat_end_transaction_bio(&softc->device_stats, bp);
biodone(bp);
break;
}
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index 138c51a..0e1b46e 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -190,7 +190,7 @@ struct sa_softc {
sa_state state;
sa_flags flags;
sa_quirks quirks;
- struct buf_queue_head buf_queue;
+ struct bio_queue_head bio_queue;
int queue_count;
struct devstat device_stats;
struct sa_devs devs;
@@ -620,21 +620,21 @@ saclose(dev_t dev, int flag, int fmt, struct proc *p)
* only one physical transfer.
*/
static void
-sastrategy(struct buf *bp)
+sastrategy(struct bio *bp)
{
struct cam_periph *periph;
struct sa_softc *softc;
u_int unit;
int s;
- if (SA_IS_CTRL(bp->b_dev)) {
- bp->b_error = EINVAL;
+ if (SA_IS_CTRL(bp->bio_dev)) {
+ bp->bio_error = EINVAL;
goto bad;
}
- unit = SAUNIT(bp->b_dev);
+ unit = SAUNIT(bp->bio_dev);
periph = cam_extend_get(saperiphs, unit);
if (periph == NULL) {
- bp->b_error = ENXIO;
+ bp->bio_error = ENXIO;
goto bad;
}
softc = (struct sa_softc *)periph->softc;
@@ -643,13 +643,13 @@ sastrategy(struct buf *bp)
if (softc->flags & SA_FLAG_INVALID) {
splx(s);
- bp->b_error = ENXIO;
+ bp->bio_error = ENXIO;
goto bad;
}
if (softc->flags & SA_FLAG_TAPE_FROZEN) {
splx(s);
- bp->b_error = EPERM;
+ bp->bio_error = EPERM;
goto bad;
}
@@ -658,7 +658,7 @@ sastrategy(struct buf *bp)
/*
* If it's a null transfer, return immediatly
*/
- if (bp->b_bcount == 0)
+ if (bp->bio_bcount == 0)
goto done;
/* valid request? */
@@ -668,19 +668,19 @@ sastrategy(struct buf *bp)
* be a multiple of our block size.
*/
if (((softc->blk_mask != ~0) &&
- ((bp->b_bcount & softc->blk_mask) != 0)) ||
+ ((bp->bio_bcount & softc->blk_mask) != 0)) ||
((softc->blk_mask == ~0) &&
- ((bp->b_bcount % softc->min_blk) != 0))) {
+ ((bp->bio_bcount % softc->min_blk) != 0))) {
xpt_print_path(periph->path);
printf("Invalid request. Fixed block device "
"requests must be a multiple "
"of %d bytes\n", softc->min_blk);
- bp->b_error = EINVAL;
+ bp->bio_error = EINVAL;
goto bad;
}
- } else if ((bp->b_bcount > softc->max_blk) ||
- (bp->b_bcount < softc->min_blk) ||
- (bp->b_bcount & softc->blk_mask) != 0) {
+ } else if ((bp->bio_bcount > softc->max_blk) ||
+ (bp->bio_bcount < softc->min_blk) ||
+ (bp->bio_bcount & softc->blk_mask) != 0) {
xpt_print_path(periph->path);
printf("Invalid request. Variable block device "
@@ -690,7 +690,7 @@ sastrategy(struct buf *bp)
}
printf("between %d and %d bytes\n", softc->min_blk,
softc->max_blk);
- bp->b_error = EINVAL;
+ bp->bio_error = EINVAL;
goto bad;
}
@@ -704,13 +704,13 @@ sastrategy(struct buf *bp)
/*
* Place it at the end of the queue.
*/
- bufq_insert_tail(&softc->buf_queue, bp);
+ bioq_insert_tail(&softc->bio_queue, bp);
softc->queue_count++;
CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("sastrategy: enqueuing a %d "
- "%s byte %s queue count now %d\n", (int) bp->b_bcount,
+ "%s byte %s queue count now %d\n", (int) bp->bio_bcount,
(softc->flags & SA_FLAG_FIXED)? "fixed" : "variable",
- (bp->b_iocmd == BIO_READ)? "read" : "write", softc->queue_count));
+ (bp->bio_cmd == BIO_READ)? "read" : "write", softc->queue_count));
splx(s);
@@ -721,13 +721,13 @@ sastrategy(struct buf *bp)
return;
bad:
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_flags |= BIO_ERROR;
done:
/*
* Correctly set the buf to indicate a completed xfer
*/
- bp->b_resid = bp->b_bcount;
+ bp->bio_resid = bp->bio_bcount;
biodone(bp);
}
@@ -1221,7 +1221,7 @@ static void
saoninvalidate(struct cam_periph *periph)
{
struct sa_softc *softc;
- struct buf *q_bp;
+ struct bio *q_bp;
struct ccb_setasync csa;
int s;
@@ -1252,11 +1252,11 @@ saoninvalidate(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);
}
softc->queue_count = 0;
@@ -1367,7 +1367,7 @@ saregister(struct cam_periph *periph, void *arg)
softc->fileno = (daddr_t) -1;
softc->blkno = (daddr_t) -1;
- bufq_init(&softc->buf_queue);
+ bioq_init(&softc->bio_queue);
periph->softc = softc;
cam_extend_set(saperiphs, periph->unit_number, periph);
@@ -1464,14 +1464,14 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
case SA_STATE_NORMAL:
{
/* Pull a buffer from the queue and get going on it */
- struct buf *bp;
+ struct bio *bp;
int s;
/*
* See if there is a buf with work for us to do..
*/
s = splbio();
- bp = bufq_first(&softc->buf_queue);
+ bp = bioq_first(&softc->bio_queue);
if (periph->immediate_priority <= periph->pinfo.priority) {
CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE,
("queuing for immediate ccb\n"));
@@ -1485,25 +1485,25 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
splx(s);
xpt_release_ccb(start_ccb);
} else if ((softc->flags & SA_FLAG_ERR_PENDING) != 0) {
- struct buf *done_bp;
+ struct bio *done_bp;
softc->queue_count--;
- bufq_remove(&softc->buf_queue, bp);
- bp->b_resid = bp->b_bcount;
- bp->b_ioflags |= BIO_ERROR;
+ bioq_remove(&softc->bio_queue, bp);
+ bp->bio_resid = bp->bio_bcount;
+ bp->bio_flags |= BIO_ERROR;
if ((softc->flags & SA_FLAG_EOM_PENDING) != 0) {
- if (bp->b_iocmd == BIO_WRITE)
- bp->b_error = ENOSPC;
+ if (bp->bio_cmd == BIO_WRITE)
+ bp->bio_error = ENOSPC;
else
- bp->b_error = EIO;
+ bp->bio_error = EIO;
}
if ((softc->flags & SA_FLAG_EOF_PENDING) != 0) {
- bp->b_error = EIO;
+ bp->bio_error = EIO;
}
if ((softc->flags & SA_FLAG_EIO_PENDING) != 0) {
- bp->b_error = EIO;
+ bp->bio_error = EIO;
}
done_bp = bp;
- bp = bufq_first(&softc->buf_queue);
+ bp = bioq_first(&softc->bio_queue);
/*
* Only if we have no other buffers queued up
* do we clear the pending error flag.
@@ -1521,18 +1521,18 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
} else {
u_int32_t length;
- bufq_remove(&softc->buf_queue, bp);
+ bioq_remove(&softc->bio_queue, bp);
softc->queue_count--;
if ((softc->flags & SA_FLAG_FIXED) != 0) {
if (softc->blk_shift != 0) {
length =
- bp->b_bcount >> softc->blk_shift;
+ bp->bio_bcount >> softc->blk_shift;
} else if (softc->media_blksize != 0) {
length =
- bp->b_bcount / softc->media_blksize;
+ bp->bio_bcount / softc->media_blksize;
} else {
- bp->b_error = EIO;
+ bp->bio_error = EIO;
xpt_print_path(periph->path);
printf("zero blocksize for "
"FIXED length writes?\n");
@@ -1543,7 +1543,7 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
("Fixed Record Count is %d\n", length));
} else {
- length = bp->b_bcount;
+ length = bp->bio_bcount;
CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO,
("Variable Record Count is %d\n", length));
}
@@ -1568,16 +1568,16 @@ sastart(struct cam_periph *periph, union ccb *start_ccb)
* have to do deal with 512 byte or 1KB intermediate
* records.
*/
- softc->dsreg = (bp->b_iocmd == BIO_READ)?
+ softc->dsreg = (bp->bio_cmd == BIO_READ)?
MTIO_DSREG_RD : MTIO_DSREG_WR;
scsi_sa_read_write(&start_ccb->csio, 0, sadone,
- MSG_SIMPLE_Q_TAG, (bp->b_iocmd == BIO_READ),
+ MSG_SIMPLE_Q_TAG, (bp->bio_cmd == BIO_READ),
FALSE, (softc->flags & SA_FLAG_FIXED) != 0,
- length, bp->b_data, bp->b_bcount, SSD_FULL_SIZE,
+ length, bp->bio_data, bp->bio_bcount, SSD_FULL_SIZE,
120 * 60 * 1000);
start_ccb->ccb_h.ccb_type = SA_CCB_BUFFER_IO;
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);
}
@@ -1607,11 +1607,11 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
switch (csio->ccb_h.ccb_type) {
case SA_CCB_BUFFER_IO:
{
- struct buf *bp;
+ struct bio *bp;
int error;
softc->dsreg = MTIO_DSREG_REST;
- 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) {
if ((error = saerror(done_ccb, 0, 0)) == ERESTART) {
@@ -1624,7 +1624,7 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
if (error == EIO) {
int s;
- struct buf *q_bp;
+ struct bio *q_bp;
/*
* Catastrophic error. Mark the tape as frozen
@@ -1639,29 +1639,29 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
s = splbio();
softc->flags |= SA_FLAG_TAPE_FROZEN;
- 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);
}
if (error != 0) {
- 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;
/*
* In the error case, position is updated in saerror.
*/
} else {
- bp->b_resid = csio->resid;
- bp->b_error = 0;
+ bp->bio_resid = csio->resid;
+ bp->bio_error = 0;
if (csio->resid != 0) {
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_flags |= BIO_ERROR;
}
- if (bp->b_iocmd == BIO_WRITE) {
+ if (bp->bio_cmd == BIO_WRITE) {
softc->flags |= SA_FLAG_TAPE_WRITTEN;
softc->filemarks = 0;
}
@@ -1669,10 +1669,10 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
if ((softc->flags & SA_FLAG_FIXED) != 0) {
u_int32_t l;
if (softc->blk_shift != 0) {
- l = bp->b_bcount >>
+ l = bp->bio_bcount >>
softc->blk_shift;
} else {
- l = bp->b_bcount /
+ l = bp->bio_bcount /
softc->media_blksize;
}
softc->blkno += (daddr_t) l;
@@ -1688,13 +1688,13 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
if (error || (softc->flags & SA_FLAG_ERR_PENDING))
cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0);
#ifdef CAMDEBUG
- if (error || bp->b_resid) {
+ if (error || bp->bio_resid) {
CAM_DEBUG(periph->path, CAM_DEBUG_INFO,
("error %d resid %ld count %ld\n", error,
- bp->b_resid, bp->b_bcount));
+ bp->bio_resid, bp->bio_bcount));
}
#endif
- devstat_end_transaction_buf(&softc->device_stats, bp);
+ devstat_end_transaction_bio(&softc->device_stats, bp);
biodone(bp);
break;
}
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index 6b6dfec..e5cc611 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -124,13 +124,13 @@ struct targ_softc {
* Userland buffers for SEND commands waiting for
* SEND ATIOs to be queued by an initiator.
*/
- struct buf_queue_head snd_buf_queue;
+ struct bio_queue_head snd_bio_queue;
/*
* Userland buffers for RCV commands waiting for
* RCV ATIOs to be queued by an initiator.
*/
- struct buf_queue_head rcv_buf_queue;
+ struct bio_queue_head rcv_bio_queue;
struct devstat device_stats;
dev_t targ_dev;
struct selinfo snd_select;
@@ -152,7 +152,7 @@ struct targ_cmd_desc {
u_int data_increment;/* Amount to send before next disconnect */
void* data; /* The data. Can be from backing_store or not */
void* backing_store;/* Backing store allocated for this descriptor*/
- struct buf *bp; /* Buffer for this transfer */
+ struct bio *bp; /* Buffer for this transfer */
u_int max_size; /* Size of backing_store */
u_int32_t timeout;
u_int8_t status; /* Status to return to initiator */
@@ -457,8 +457,8 @@ targctor(struct cam_periph *periph, void *arg)
TAILQ_INIT(&softc->snd_ccb_queue);
TAILQ_INIT(&softc->rcv_ccb_queue);
TAILQ_INIT(&softc->unknown_atio_queue);
- bufq_init(&softc->snd_buf_queue);
- bufq_init(&softc->rcv_buf_queue);
+ bioq_init(&softc->snd_bio_queue);
+ bioq_init(&softc->rcv_bio_queue);
softc->accept_tio_list = NULL;
SLIST_INIT(&softc->immed_notify_slist);
softc->state = TARG_STATE_NORMAL;
@@ -1029,12 +1029,12 @@ targpoll(dev_t dev, int poll_events, struct proc *p)
s = splcam();
if ((poll_events & (POLLOUT | POLLWRNORM)) != 0) {
if (TAILQ_FIRST(&softc->rcv_ccb_queue) != NULL
- && bufq_first(&softc->rcv_buf_queue) == NULL)
+ && bioq_first(&softc->rcv_bio_queue) == NULL)
revents |= poll_events & (POLLOUT | POLLWRNORM);
}
if ((poll_events & (POLLIN | POLLRDNORM)) != 0) {
if (TAILQ_FIRST(&softc->snd_ccb_queue) != NULL
- && bufq_first(&softc->snd_buf_queue) == NULL)
+ && bioq_first(&softc->snd_bio_queue) == NULL)
revents |= poll_events & (POLLIN | POLLRDNORM);
}
@@ -1117,24 +1117,24 @@ targwrite(dev_t dev, struct uio *uio, int ioflag)
* only one physical transfer.
*/
static void
-targstrategy(struct buf *bp)
+targstrategy(struct bio *bp)
{
struct cam_periph *periph;
struct targ_softc *softc;
u_int unit;
int s;
- unit = minor(bp->b_dev);
+ unit = minor(bp->bio_dev);
/* ioctl is the only supported operation of the control device */
if (TARG_IS_CONTROL_DEV(unit)) {
- bp->b_error = EINVAL;
+ bp->bio_error = EINVAL;
goto bad;
}
periph = cam_extend_get(targperiphs, unit);
if (periph == NULL) {
- bp->b_error = ENXIO;
+ bp->bio_error = ENXIO;
goto bad;
}
softc = (struct targ_softc *)periph->softc;
@@ -1153,9 +1153,9 @@ targstrategy(struct buf *bp)
splx(s);
if (softc->state == TARG_STATE_EXCEPTION
&& (softc->exceptions & TARG_EXCEPT_DEVICE_INVALID) == 0)
- bp->b_error = EBUSY;
+ bp->bio_error = EBUSY;
else
- bp->b_error = ENXIO;
+ bp->bio_error = ENXIO;
goto bad;
}
@@ -1164,15 +1164,15 @@ targstrategy(struct buf *bp)
* SEND or RECEIVE commands.
*
*/
- bp->b_resid = bp->b_bcount;
- if (bp->b_iocmd == BIO_READ) {
+ bp->bio_resid = bp->bio_bcount;
+ if (bp->bio_cmd == BIO_READ) {
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
("Queued a SEND buffer\n"));
- bufq_insert_tail(&softc->snd_buf_queue, bp);
+ bioq_insert_tail(&softc->snd_bio_queue, bp);
} else {
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
("Queued a RECEIVE buffer\n"));
- bufq_insert_tail(&softc->rcv_buf_queue, bp);
+ bioq_insert_tail(&softc->rcv_bio_queue, bp);
}
splx(s);
@@ -1185,12 +1185,12 @@ targstrategy(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);
}
@@ -1199,15 +1199,15 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
{
struct ccb_queue *pending_queue;
struct ccb_accept_tio *atio;
- struct buf_queue_head *bufq;
- struct buf *bp;
+ struct bio_queue_head *bioq;
+ struct bio *bp;
struct targ_cmd_desc *desc;
struct ccb_hdr *ccbh;
int s;
s = splbio();
pending_queue = NULL;
- bufq = NULL;
+ bioq = NULL;
ccbh = NULL;
/* Only run one request at a time to maintain data ordering. */
if (softc->state != TARG_STATE_NORMAL
@@ -1217,7 +1217,7 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
return;
}
- if (((bp = bufq_first(&softc->snd_buf_queue)) != NULL
+ if (((bp = bioq_first(&softc->snd_bio_queue)) != NULL
|| (softc->flags & TARG_FLAG_SEND_EOF) != 0)
&& (ccbh = TAILQ_FIRST(&softc->snd_ccb_queue)) != NULL) {
@@ -1226,11 +1226,11 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
else {
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
("De-Queued a SEND buffer %ld\n",
- bp->b_bcount));
+ bp->bio_bcount));
}
- bufq = &softc->snd_buf_queue;
+ bioq = &softc->snd_bio_queue;
pending_queue = &softc->snd_ccb_queue;
- } else if (((bp = bufq_first(&softc->rcv_buf_queue)) != NULL
+ } else if (((bp = bioq_first(&softc->rcv_bio_queue)) != NULL
|| (softc->flags & TARG_FLAG_RECEIVE_EOF) != 0)
&& (ccbh = TAILQ_FIRST(&softc->rcv_ccb_queue)) != NULL) {
@@ -1239,9 +1239,9 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
else {
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
("De-Queued a RECEIVE buffer %ld\n",
- bp->b_bcount));
+ bp->bio_bcount));
}
- bufq = &softc->rcv_buf_queue;
+ bioq = &softc->rcv_bio_queue;
pending_queue = &softc->rcv_ccb_queue;
}
@@ -1259,10 +1259,10 @@ targrunqueue(struct cam_periph *periph, struct targ_softc *softc)
atio->ccb_h.flags &= ~CAM_DIR_MASK;
atio->ccb_h.flags |= CAM_DIR_NONE;
} else {
- bufq_remove(bufq, bp);
- desc->data = &bp->b_data[bp->b_bcount - bp->b_resid];
+ bioq_remove(bioq, bp);
+ desc->data = &bp->bio_data[bp->bio_bcount - bp->bio_resid];
desc->data_increment =
- MIN(desc->data_resid, bp->b_resid);
+ MIN(desc->data_resid, bp->bio_resid);
desc->data_increment =
MIN(desc->data_increment, 32);
}
@@ -1634,7 +1634,7 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
struct ccb_scsiio *csio;
struct ccb_accept_tio *atio;
struct targ_cmd_desc *desc;
- struct buf *bp;
+ struct bio *bp;
int error;
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
@@ -1686,23 +1686,23 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
desc->data_resid -= desc->data_increment;
if ((bp = desc->bp) != NULL) {
- bp->b_resid -= desc->data_increment;
- bp->b_error = error;
+ bp->bio_resid -= desc->data_increment;
+ bp->bio_error = error;
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
("Buffer I/O Completed - Resid %ld:%d\n",
- bp->b_resid, desc->data_resid));
+ bp->bio_resid, desc->data_resid));
/*
* Send the buffer back to the client if
* either the command has completed or all
* buffer space has been consumed.
*/
if (desc->data_resid == 0
- || bp->b_resid == 0
+ || bp->bio_resid == 0
|| error != 0) {
- if (bp->b_resid != 0)
+ if (bp->bio_resid != 0)
/* Short transfer */
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_flags |= BIO_ERROR;
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
("Completing a buffer\n"));
@@ -1729,7 +1729,7 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
if (atio->cdb_io.cdb_bytes[0] == SEND) {
if (desc->bp != NULL)
TAILQ_INSERT_HEAD(
- &softc->snd_buf_queue.queue,
+ &softc->snd_bio_queue.queue,
bp, b_act);
TAILQ_INSERT_HEAD(&softc->snd_ccb_queue,
&atio->ccb_h,
@@ -1737,7 +1737,7 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
} else {
if (desc->bp != NULL)
TAILQ_INSERT_HEAD(
- &softc->rcv_buf_queue.queue,
+ &softc->rcv_bio_queue.queue,
bp, b_act);
TAILQ_INSERT_HEAD(&softc->rcv_ccb_queue,
&atio->ccb_h,
@@ -1747,8 +1747,8 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
targrunqueue(periph, softc);
} else {
if (desc->bp != NULL) {
- bp->b_ioflags |= BIO_ERROR;
- bp->b_error = ENXIO;
+ bp->bio_flags |= BIO_ERROR;
+ bp->bio_error = ENXIO;
biodone(bp);
}
freedescr(desc);
@@ -1807,7 +1807,7 @@ targfireexception(struct cam_periph *periph, struct targ_softc *softc)
* the waking process will wakeup, call our poll routine again,
* and pick up the exception.
*/
- struct buf *bp;
+ struct bio *bp;
if (softc->state != TARG_STATE_NORMAL)
/* Already either tearing down or in exception state */
@@ -1815,15 +1815,15 @@ targfireexception(struct cam_periph *periph, struct targ_softc *softc)
softc->state = TARG_STATE_EXCEPTION;
- while ((bp = bufq_first(&softc->snd_buf_queue)) != NULL) {
- bufq_remove(&softc->snd_buf_queue, bp);
- bp->b_ioflags |= BIO_ERROR;
+ while ((bp = bioq_first(&softc->snd_bio_queue)) != NULL) {
+ bioq_remove(&softc->snd_bio_queue, bp);
+ bp->bio_flags |= BIO_ERROR;
biodone(bp);
}
- while ((bp = bufq_first(&softc->rcv_buf_queue)) != NULL) {
- bufq_remove(&softc->snd_buf_queue, bp);
- bp->b_ioflags |= BIO_ERROR;
+ while ((bp = bioq_first(&softc->rcv_bio_queue)) != NULL) {
+ bioq_remove(&softc->snd_bio_queue, bp);
+ bp->bio_flags |= BIO_ERROR;
biodone(bp);
}
@@ -2159,11 +2159,11 @@ abort_pending_transactions(struct cam_periph *periph, u_int initiator_id,
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
("Aborting ATIO\n"));
if (desc->bp != NULL) {
- desc->bp->b_ioflags |= BIO_ERROR;
+ desc->bp->bio_flags |= BIO_ERROR;
if (softc->state != TARG_STATE_TEARDOWN)
- desc->bp->b_error = errno;
+ desc->bp->bio_error = errno;
else
- desc->bp->b_error = ENXIO;
+ desc->bp->bio_error = ENXIO;
biodone(desc->bp);
desc->bp = NULL;
}
OpenPOWER on IntegriCloud