Commit 7a31ec3c authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley

[SCSI] st: convert get_location to use st_scsi_kern_execute

This replaces st_do_scsi in get_location (READ_POSITION) with
st_scsi_kern_execute.
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: default avatarKai Makisara <Kai.Makisara@kolumbus.fi>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 18c87015
...@@ -3019,11 +3019,17 @@ static int get_location(struct scsi_tape *STp, unsigned int *block, int *partiti ...@@ -3019,11 +3019,17 @@ static int get_location(struct scsi_tape *STp, unsigned int *block, int *partiti
if (!logical && !STp->scsi2_logical) if (!logical && !STp->scsi2_logical)
scmd[1] = 1; scmd[1] = 1;
} }
SRpnt = st_do_scsi(NULL, STp, scmd, 20, DMA_FROM_DEVICE,
STp->device->request_queue->rq_timeout, SRpnt = st_allocate_request(STp);
MAX_READY_RETRIES, 1);
if (!SRpnt) if (!SRpnt)
return (STp->buffer)->syscall_result; return STp->buffer->syscall_result;
result = st_scsi_kern_execute(SRpnt, scmd, DMA_FROM_DEVICE,
STp->buffer->b_data, 20,
STp->device->request_queue->rq_timeout,
MAX_READY_RETRIES);
if (result)
goto out;
if ((STp->buffer)->syscall_result != 0 || if ((STp->buffer)->syscall_result != 0 ||
(STp->device->scsi_level >= SCSI_2 && (STp->device->scsi_level >= SCSI_2 &&
...@@ -3051,6 +3057,7 @@ static int get_location(struct scsi_tape *STp, unsigned int *block, int *partiti ...@@ -3051,6 +3057,7 @@ static int get_location(struct scsi_tape *STp, unsigned int *block, int *partiti
DEBC(printk(ST_DEB_MSG "%s: Got tape pos. blk %d part %d.\n", name, DEBC(printk(ST_DEB_MSG "%s: Got tape pos. blk %d part %d.\n", name,
*block, *partition)); *block, *partition));
} }
out:
st_release_request(SRpnt); st_release_request(SRpnt);
SRpnt = NULL; SRpnt = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment