aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2005-11-11 06:31:37 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-12-14 22:04:11 -0500
commit17e01f216b611fc46956dcd9063aec4de75991e3 (patch)
treee8864490fddd1d67c7911101a1446709ec21720e /drivers/scsi/scsi_lib.c
parent6e68af666f5336254b5715dca591026b7324499a (diff)
[SCSI] add retries field to request for REQ_BLOCK_PC use
For tape we need to control the retries. This patch adds a retries counter on the request for REQ_BLOCK_PC commands originating from scsi_execute* to use. REQ_BLOCK_PC commands comming from the block layer SG_IO path continue to use the retires set in the ULD init_command. (scsi_execute* does not set the gendisk so we do not execute the init_command in that path). Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index eb0cfbfbcf8f..365843a1561f 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -259,6 +259,7 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
259 memcpy(req->cmd, cmd, req->cmd_len); 259 memcpy(req->cmd, cmd, req->cmd_len);
260 req->sense = sense; 260 req->sense = sense;
261 req->sense_len = 0; 261 req->sense_len = 0;
262 req->retries = retries;
262 req->timeout = timeout; 263 req->timeout = timeout;
263 req->flags |= flags | REQ_BLOCK_PC | REQ_SPECIAL | REQ_QUIET; 264 req->flags |= flags | REQ_BLOCK_PC | REQ_SPECIAL | REQ_QUIET;
264 265
@@ -472,6 +473,7 @@ int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd,
472 req->sense = sioc->sense; 473 req->sense = sioc->sense;
473 req->sense_len = 0; 474 req->sense_len = 0;
474 req->timeout = timeout; 475 req->timeout = timeout;
476 req->retries = retries;
475 req->flags |= REQ_BLOCK_PC | REQ_QUIET; 477 req->flags |= REQ_BLOCK_PC | REQ_QUIET;
476 req->end_io_data = sioc; 478 req->end_io_data = sioc;
477 479
@@ -1393,7 +1395,7 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req)
1393 cmd->sc_data_direction = DMA_NONE; 1395 cmd->sc_data_direction = DMA_NONE;
1394 1396
1395 cmd->transfersize = req->data_len; 1397 cmd->transfersize = req->data_len;
1396 cmd->allowed = 3; 1398 cmd->allowed = req->retries;
1397 cmd->timeout_per_command = req->timeout; 1399 cmd->timeout_per_command = req->timeout;
1398 cmd->done = scsi_generic_done; 1400 cmd->done = scsi_generic_done;
1399 } 1401 }