block, scsi: move the retries field to struct scsi_request
Instead of bloating the generic struct request with it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Родитель
44e44b29fb
Коммит
64c7f1d157
|
@ -362,7 +362,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
|
|||
goto out_free_cdb;
|
||||
|
||||
bio = rq->bio;
|
||||
rq->retries = 0;
|
||||
req->retries = 0;
|
||||
|
||||
start_time = jiffies;
|
||||
|
||||
|
@ -476,13 +476,13 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
|
|||
goto error;
|
||||
|
||||
/* default. possible overriden later */
|
||||
rq->retries = 5;
|
||||
req->retries = 5;
|
||||
|
||||
switch (opcode) {
|
||||
case SEND_DIAGNOSTIC:
|
||||
case FORMAT_UNIT:
|
||||
rq->timeout = FORMAT_UNIT_TIMEOUT;
|
||||
rq->retries = 1;
|
||||
req->retries = 1;
|
||||
break;
|
||||
case START_STOP:
|
||||
rq->timeout = START_STOP_TIMEOUT;
|
||||
|
@ -495,7 +495,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
|
|||
break;
|
||||
case READ_DEFECT_DATA:
|
||||
rq->timeout = READ_DEFECT_DATA_TIMEOUT;
|
||||
rq->retries = 1;
|
||||
req->retries = 1;
|
||||
break;
|
||||
default:
|
||||
rq->timeout = BLK_DEFAULT_SG_TIMEOUT;
|
||||
|
|
|
@ -1602,7 +1602,7 @@ static int _init_blk_request(struct osd_request *or,
|
|||
req->rq_flags |= RQF_QUIET;
|
||||
|
||||
req->timeout = or->timeout;
|
||||
req->retries = or->retries;
|
||||
scsi_req(req)->retries = or->retries;
|
||||
|
||||
if (has_out) {
|
||||
or->out.req = req;
|
||||
|
|
|
@ -414,7 +414,7 @@ static int osst_execute(struct osst_request *SRpnt, const unsigned char *cmd,
|
|||
memset(rq->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
|
||||
memcpy(rq->cmd, cmd, rq->cmd_len);
|
||||
req->timeout = timeout;
|
||||
req->retries = retries;
|
||||
rq->retries = retries;
|
||||
req->end_io_data = SRpnt;
|
||||
|
||||
blk_execute_rq_nowait(req->q, NULL, req, 1, osst_end_async);
|
||||
|
|
|
@ -1988,7 +1988,7 @@ static void scsi_eh_lock_door(struct scsi_device *sdev)
|
|||
|
||||
req->rq_flags |= RQF_QUIET;
|
||||
req->timeout = 10 * HZ;
|
||||
req->retries = 5;
|
||||
rq->retries = 5;
|
||||
|
||||
blk_execute_rq_nowait(req->q, NULL, req, 1, eh_lock_door_done);
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
|
|||
|
||||
rq->cmd_len = COMMAND_SIZE(cmd[0]);
|
||||
memcpy(rq->cmd, cmd, rq->cmd_len);
|
||||
req->retries = retries;
|
||||
rq->retries = retries;
|
||||
req->timeout = timeout;
|
||||
req->cmd_flags |= flags;
|
||||
req->rq_flags |= rq_flags | RQF_QUIET | RQF_PREEMPT;
|
||||
|
@ -1177,7 +1177,7 @@ static int scsi_setup_scsi_cmnd(struct scsi_device *sdev, struct request *req)
|
|||
cmd->cmd_len = scsi_req(req)->cmd_len;
|
||||
cmd->cmnd = scsi_req(req)->cmd;
|
||||
cmd->transfersize = blk_rq_bytes(req);
|
||||
cmd->allowed = req->retries;
|
||||
cmd->allowed = scsi_req(req)->retries;
|
||||
return BLKPREP_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1716,7 +1716,7 @@ sg_start_req(Sg_request *srp, unsigned char *cmd)
|
|||
|
||||
srp->rq = rq;
|
||||
rq->end_io_data = srp;
|
||||
rq->retries = SG_DEFAULT_RETRIES;
|
||||
req->retries = SG_DEFAULT_RETRIES;
|
||||
|
||||
if ((dxfer_len <= 0) || (dxfer_dir == SG_DXFER_NONE))
|
||||
return 0;
|
||||
|
|
|
@ -579,7 +579,7 @@ static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd,
|
|||
memset(rq->cmd, 0, BLK_MAX_CDB);
|
||||
memcpy(rq->cmd, cmd, rq->cmd_len);
|
||||
req->timeout = timeout;
|
||||
req->retries = retries;
|
||||
rq->retries = retries;
|
||||
req->end_io_data = SRpnt;
|
||||
|
||||
blk_execute_rq_nowait(req->q, NULL, req, 1, st_scsi_execute_end);
|
||||
|
|
|
@ -1008,7 +1008,7 @@ pscsi_execute_cmd(struct se_cmd *cmd)
|
|||
req->timeout = PS_TIMEOUT_DISK;
|
||||
else
|
||||
req->timeout = PS_TIMEOUT_OTHER;
|
||||
req->retries = PS_RETRY;
|
||||
scsi_req(req)->retries = PS_RETRY;
|
||||
|
||||
blk_execute_rq_nowait(pdv->pdv_sd->request_queue, NULL, req,
|
||||
(cmd->sam_task_attr == TCM_HEAD_TAG),
|
||||
|
|
|
@ -224,7 +224,6 @@ struct request {
|
|||
unsigned long deadline;
|
||||
struct list_head timeout_list;
|
||||
unsigned int timeout;
|
||||
int retries;
|
||||
|
||||
/*
|
||||
* completion callback.
|
||||
|
|
|
@ -11,6 +11,7 @@ struct scsi_request {
|
|||
unsigned short cmd_len;
|
||||
unsigned int sense_len;
|
||||
unsigned int resid_len; /* residual count */
|
||||
int retries;
|
||||
void *sense;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче