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>
        memcpy(req->cmd, cmd, req->cmd_len);
        req->sense = sense;
        req->sense_len = 0;
+       req->retries = retries;
        req->timeout = timeout;
        req->flags |= flags | REQ_BLOCK_PC | REQ_SPECIAL | REQ_QUIET;
 
        req->sense = sioc->sense;
        req->sense_len = 0;
        req->timeout = timeout;
+       req->retries = retries;
        req->flags |= REQ_BLOCK_PC | REQ_QUIET;
        req->end_io_data = sioc;
 
                                cmd->sc_data_direction = DMA_NONE;
                        
                        cmd->transfersize = req->data_len;
-                       cmd->allowed = 3;
+                       cmd->allowed = req->retries;
                        cmd->timeout_per_command = req->timeout;
                        cmd->done = scsi_generic_done;
                }
 
        void *sense;
 
        unsigned int timeout;
+       int retries;
 
        /*
         * For Power Management requests