From 7b16318dea8d9840dac567a2ae8c50ecdea36aea Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Thu, 15 Dec 2005 20:17:02 -0600 Subject: Fix up SCSI mismerge I forgot to do a git-update-cache on the merged files ... --- drivers/scsi/scsi_lib.c | 33 +++++++++++++++++++++------------ drivers/scsi/sd.c | 2 +- drivers/scsi/sr.c | 2 +- drivers/scsi/st.c | 2 +- 4 files changed, 24 insertions(+), 15 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 14ad2a785a3..a7f3f0c84db 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1259,6 +1259,26 @@ static void scsi_generic_done(struct scsi_cmnd *cmd) scsi_io_completion(cmd, cmd->bufflen, 0); } +void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd) +{ + struct request *req = cmd->request; + + BUG_ON(sizeof(req->cmd) > sizeof(cmd->cmnd)); + memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); + cmd->cmd_len = req->cmd_len; + if (!req->data_len) + cmd->sc_data_direction = DMA_NONE; + else if (rq_data_dir(req) == WRITE) + cmd->sc_data_direction = DMA_TO_DEVICE; + else + cmd->sc_data_direction = DMA_FROM_DEVICE; + + cmd->transfersize = req->data_len; + cmd->allowed = req->retries; + cmd->timeout_per_command = req->timeout; +} +EXPORT_SYMBOL_GPL(scsi_setup_blk_pc_cmnd); + static int scsi_prep_fn(struct request_queue *q, struct request *req) { struct scsi_device *sdev = q->queuedata; @@ -1394,18 +1414,7 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) goto kill; } } else { - memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); - cmd->cmd_len = req->cmd_len; - if (rq_data_dir(req) == WRITE) - cmd->sc_data_direction = DMA_TO_DEVICE; - else if (req->data_len) - cmd->sc_data_direction = DMA_FROM_DEVICE; - else - cmd->sc_data_direction = DMA_NONE; - - cmd->transfersize = req->data_len; - cmd->allowed = req->retries; - cmd->timeout_per_command = req->timeout; + scsi_setup_blk_pc_cmnd(cmd); cmd->done = scsi_generic_done; } } diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 9d893f08501..3d3ad7d1b77 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -245,7 +245,7 @@ static int sd_init_command(struct scsi_cmnd * SCpnt) * SG_IO from block layer already setup, just copy cdb basically */ if (blk_pc_request(rq)) { - scsi_setup_blk_pc_cmnd(SCpnt, SD_PASSTHROUGH_RETRIES); + scsi_setup_blk_pc_cmnd(SCpnt); if (rq->timeout) timeout = rq->timeout; diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 7e7398d563c..a4d9be7c687 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -320,7 +320,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt) * these are already setup, just copy cdb basically */ if (SCpnt->request->flags & REQ_BLOCK_PC) { - scsi_setup_blk_pc_cmnd(SCpnt, MAX_RETRIES); + scsi_setup_blk_pc_cmnd(SCpnt); if (SCpnt->timeout_per_command) timeout = SCpnt->timeout_per_command; diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 894ad53be04..c4aade8f534 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -4198,7 +4198,7 @@ static int st_init_command(struct scsi_cmnd *SCpnt) if (!(SCpnt->request->flags & REQ_BLOCK_PC)) return 0; - scsi_setup_blk_pc_cmnd(SCpnt, 0); + scsi_setup_blk_pc_cmnd(SCpnt); SCpnt->done = st_intr; return 1; } -- cgit v1.2.3