Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124665
b: refs/heads/master
c: 18c8701
h: refs/heads/master
i:
  124663: c68a85b
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Dec 29, 2008
1 parent 66f3463 commit ab6e566
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ecf0d994a8d3fb439e1efea6f60c22831bf69c8
refs/heads/master: 18c87015741d931875038789957db55b00661f5b
21 changes: 14 additions & 7 deletions trunk/drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -2399,9 +2399,9 @@ static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs)
in the buffer is correctly formatted. The long timeout is used if slow is non-zero. */
static int write_mode_page(struct scsi_tape *STp, int page, int slow)
{
int pgo;
int pgo, timeout, ret = 0;
unsigned char cmd[MAX_COMMAND_SIZE];
struct st_request *SRpnt = NULL;
struct st_request *SRpnt;

memset(cmd, 0, MAX_COMMAND_SIZE);
cmd[0] = MODE_SELECT;
Expand All @@ -2415,14 +2415,21 @@ static int write_mode_page(struct scsi_tape *STp, int page, int slow)
(STp->buffer)->b_data[MH_OFF_DEV_SPECIFIC] &= ~MH_BIT_WP;
(STp->buffer)->b_data[pgo + MP_OFF_PAGE_NBR] &= MP_MSK_PAGE_NBR;

SRpnt = st_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_TO_DEVICE,
(slow ? STp->long_timeout : STp->device->request_queue->rq_timeout), 0, 1);
if (SRpnt == NULL)
return (STp->buffer)->syscall_result;
SRpnt = st_allocate_request(STp);
if (!SRpnt)
return ret;

timeout = slow ? STp->long_timeout :
STp->device->request_queue->rq_timeout;

ret = st_scsi_kern_execute(SRpnt, cmd, DMA_TO_DEVICE,
STp->buffer->b_data, cmd[4], timeout, 0);
if (!ret)
ret = STp->buffer->syscall_result;

st_release_request(SRpnt);

return (STp->buffer)->syscall_result;
return ret;
}


Expand Down

0 comments on commit ab6e566

Please sign in to comment.