diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-12-05 01:25:27 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-12-29 12:24:30 -0500 |
commit | 52107b2c575d76bf210ff7e995128042594324ac (patch) | |
tree | 2a917a9a62f1e0ffa026d74a3aba4cb9b5ec8c16 | |
parent | 212cd8bfe12bb115e7bc9e119fe1411451829afb (diff) |
[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>
-rw-r--r-- | drivers/scsi/st.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 708e9e90678f..322ca87d252e 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -1020,17 +1020,24 @@ static int check_tape(struct scsi_tape *STp, struct file *filp) | |||
1020 | } | 1020 | } |
1021 | } | 1021 | } |
1022 | 1022 | ||
1023 | SRpnt = st_allocate_request(STp); | ||
1024 | if (!SRpnt) { | ||
1025 | retval = STp->buffer->syscall_result; | ||
1026 | goto err_out; | ||
1027 | } | ||
1028 | |||
1023 | if (STp->omit_blklims) | 1029 | if (STp->omit_blklims) |
1024 | STp->min_block = STp->max_block = (-1); | 1030 | STp->min_block = STp->max_block = (-1); |
1025 | else { | 1031 | else { |
1026 | memset((void *) &cmd[0], 0, MAX_COMMAND_SIZE); | 1032 | memset((void *) &cmd[0], 0, MAX_COMMAND_SIZE); |
1027 | cmd[0] = READ_BLOCK_LIMITS; | 1033 | cmd[0] = READ_BLOCK_LIMITS; |
1028 | 1034 | ||
1029 | SRpnt = st_do_scsi(SRpnt, STp, cmd, 6, DMA_FROM_DEVICE, | 1035 | retval = st_scsi_kern_execute(SRpnt, cmd, DMA_FROM_DEVICE, |
1030 | STp->device->request_queue->rq_timeout, | 1036 | STp->buffer->b_data, 6, |
1031 | MAX_READY_RETRIES, 1); | 1037 | STp->device->request_queue->rq_timeout, |
1032 | if (!SRpnt) { | 1038 | MAX_READY_RETRIES); |
1033 | retval = (STp->buffer)->syscall_result; | 1039 | if (retval) { |
1040 | st_release_request(SRpnt); | ||
1034 | goto err_out; | 1041 | goto err_out; |
1035 | } | 1042 | } |
1036 | 1043 | ||
@@ -1054,11 +1061,12 @@ static int check_tape(struct scsi_tape *STp, struct file *filp) | |||
1054 | cmd[0] = MODE_SENSE; | 1061 | cmd[0] = MODE_SENSE; |
1055 | cmd[4] = 12; | 1062 | cmd[4] = 12; |
1056 | 1063 | ||
1057 | SRpnt = st_do_scsi(SRpnt, STp, cmd, 12, DMA_FROM_DEVICE, | 1064 | retval = st_scsi_kern_execute(SRpnt, cmd, DMA_FROM_DEVICE, |
1058 | STp->device->request_queue->rq_timeout, | 1065 | STp->buffer->b_data, 12, |
1059 | MAX_READY_RETRIES, 1); | 1066 | STp->device->request_queue->rq_timeout, |
1060 | if (!SRpnt) { | 1067 | MAX_READY_RETRIES); |
1061 | retval = (STp->buffer)->syscall_result; | 1068 | if (retval) { |
1069 | st_release_request(SRpnt); | ||
1062 | goto err_out; | 1070 | goto err_out; |
1063 | } | 1071 | } |
1064 | 1072 | ||