aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r--drivers/scsi/st.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 770c4324f3d5..dd592f6a2529 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -4194,27 +4194,10 @@ static void st_intr(struct scsi_cmnd *SCpnt)
4194 */ 4194 */
4195static int st_init_command(struct scsi_cmnd *SCpnt) 4195static int st_init_command(struct scsi_cmnd *SCpnt)
4196{ 4196{
4197 struct request *rq;
4198
4199 if (!(SCpnt->request->flags & REQ_BLOCK_PC)) 4197 if (!(SCpnt->request->flags & REQ_BLOCK_PC))
4200 return 0; 4198 return 0;
4201 4199
4202 rq = SCpnt->request; 4200 scsi_setup_blk_pc_cmnd(SCpnt, 0);
4203 if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd))
4204 return 0;
4205
4206 memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd));
4207 SCpnt->cmd_len = rq->cmd_len;
4208
4209 if (rq_data_dir(rq) == WRITE)
4210 SCpnt->sc_data_direction = DMA_TO_DEVICE;
4211 else if (rq->data_len)
4212 SCpnt->sc_data_direction = DMA_FROM_DEVICE;
4213 else
4214 SCpnt->sc_data_direction = DMA_NONE;
4215
4216 SCpnt->timeout_per_command = rq->timeout;
4217 SCpnt->transfersize = rq->data_len;
4218 SCpnt->done = st_intr; 4201 SCpnt->done = st_intr;
4219 return 1; 4202 return 1;
4220} 4203}
@@ -4509,6 +4492,7 @@ static int sgl_map_user_pages(struct scatterlist *sgl, const unsigned int max_pa
4509 if (res > 0) { 4492 if (res > 0) {
4510 for (j=0; j < res; j++) 4493 for (j=0; j < res; j++)
4511 page_cache_release(pages[j]); 4494 page_cache_release(pages[j]);
4495 res = 0;
4512 } 4496 }
4513 kfree(pages); 4497 kfree(pages);
4514 return res; 4498 return res;
@@ -4524,8 +4508,6 @@ static int sgl_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_p
4524 for (i=0; i < nr_pages; i++) { 4508 for (i=0; i < nr_pages; i++) {
4525 struct page *page = sgl[i].page; 4509 struct page *page = sgl[i].page;
4526 4510
4527 /* XXX: just for debug. Remove when PageReserved is removed */
4528 BUG_ON(PageReserved(page));
4529 if (dirtied) 4511 if (dirtied)
4530 SetPageDirty(page); 4512 SetPageDirty(page);
4531 /* FIXME: cache flush missing for rw==READ 4513 /* FIXME: cache flush missing for rw==READ