[SCSI] st: convert check_tape to use st_scsi_kern_execute
This replaces st_do_scsi in check_tape (READ_BLOCK_LIMITS and MODE_SENSE) with st_scsi_kern_execute. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Kai Makisara <Kai.Makisara@kolumbus.fi> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
This commit is contained in:
parent
212cd8bfe1
commit
52107b2c57
@ -1020,17 +1020,24 @@ static int check_tape(struct scsi_tape *STp, struct file *filp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SRpnt = st_allocate_request(STp);
|
||||||
|
if (!SRpnt) {
|
||||||
|
retval = STp->buffer->syscall_result;
|
||||||
|
goto err_out;
|
||||||
|
}
|
||||||
|
|
||||||
if (STp->omit_blklims)
|
if (STp->omit_blklims)
|
||||||
STp->min_block = STp->max_block = (-1);
|
STp->min_block = STp->max_block = (-1);
|
||||||
else {
|
else {
|
||||||
memset((void *) &cmd[0], 0, MAX_COMMAND_SIZE);
|
memset((void *) &cmd[0], 0, MAX_COMMAND_SIZE);
|
||||||
cmd[0] = READ_BLOCK_LIMITS;
|
cmd[0] = READ_BLOCK_LIMITS;
|
||||||
|
|
||||||
SRpnt = st_do_scsi(SRpnt, STp, cmd, 6, DMA_FROM_DEVICE,
|
retval = st_scsi_kern_execute(SRpnt, cmd, DMA_FROM_DEVICE,
|
||||||
STp->device->request_queue->rq_timeout,
|
STp->buffer->b_data, 6,
|
||||||
MAX_READY_RETRIES, 1);
|
STp->device->request_queue->rq_timeout,
|
||||||
if (!SRpnt) {
|
MAX_READY_RETRIES);
|
||||||
retval = (STp->buffer)->syscall_result;
|
if (retval) {
|
||||||
|
st_release_request(SRpnt);
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1054,11 +1061,12 @@ static int check_tape(struct scsi_tape *STp, struct file *filp)
|
|||||||
cmd[0] = MODE_SENSE;
|
cmd[0] = MODE_SENSE;
|
||||||
cmd[4] = 12;
|
cmd[4] = 12;
|
||||||
|
|
||||||
SRpnt = st_do_scsi(SRpnt, STp, cmd, 12, DMA_FROM_DEVICE,
|
retval = st_scsi_kern_execute(SRpnt, cmd, DMA_FROM_DEVICE,
|
||||||
STp->device->request_queue->rq_timeout,
|
STp->buffer->b_data, 12,
|
||||||
MAX_READY_RETRIES, 1);
|
STp->device->request_queue->rq_timeout,
|
||||||
if (!SRpnt) {
|
MAX_READY_RETRIES);
|
||||||
retval = (STp->buffer)->syscall_result;
|
if (retval) {
|
||||||
|
st_release_request(SRpnt);
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user