diff options
-rw-r--r-- | block/blk-mq.c | 6 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 10 | ||||
-rw-r--r-- | include/linux/blk-mq.h | 3 |
3 files changed, 14 insertions, 5 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 298d6e360661..d12f1983d493 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -530,7 +530,7 @@ struct blk_mq_timeout_data { | |||
530 | unsigned int next_set; | 530 | unsigned int next_set; |
531 | }; | 531 | }; |
532 | 532 | ||
533 | static void blk_mq_rq_timed_out(struct request *req) | 533 | static void blk_mq_rq_timed_out(struct request *req, bool reserved) |
534 | { | 534 | { |
535 | struct blk_mq_ops *ops = req->q->mq_ops; | 535 | struct blk_mq_ops *ops = req->q->mq_ops; |
536 | enum blk_eh_timer_return ret = BLK_EH_RESET_TIMER; | 536 | enum blk_eh_timer_return ret = BLK_EH_RESET_TIMER; |
@@ -548,7 +548,7 @@ static void blk_mq_rq_timed_out(struct request *req) | |||
548 | return; | 548 | return; |
549 | 549 | ||
550 | if (ops->timeout) | 550 | if (ops->timeout) |
551 | ret = ops->timeout(req); | 551 | ret = ops->timeout(req, reserved); |
552 | 552 | ||
553 | switch (ret) { | 553 | switch (ret) { |
554 | case BLK_EH_HANDLED: | 554 | case BLK_EH_HANDLED: |
@@ -576,7 +576,7 @@ static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx, | |||
576 | 576 | ||
577 | if (time_after_eq(jiffies, rq->deadline)) { | 577 | if (time_after_eq(jiffies, rq->deadline)) { |
578 | if (!blk_mark_rq_complete(rq)) | 578 | if (!blk_mark_rq_complete(rq)) |
579 | blk_mq_rq_timed_out(rq); | 579 | blk_mq_rq_timed_out(rq, reserved); |
580 | } else if (!data->next_set || time_after(data->next, rq->deadline)) { | 580 | } else if (!data->next_set || time_after(data->next, rq->deadline)) { |
581 | data->next = rq->deadline; | 581 | data->next = rq->deadline; |
582 | data->next_set = 1; | 582 | data->next_set = 1; |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 73ce7d27f5c8..86b1156edb82 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1932,6 +1932,14 @@ out: | |||
1932 | return ret; | 1932 | return ret; |
1933 | } | 1933 | } |
1934 | 1934 | ||
1935 | static enum blk_eh_timer_return scsi_timeout(struct request *req, | ||
1936 | bool reserved) | ||
1937 | { | ||
1938 | if (reserved) | ||
1939 | return BLK_EH_RESET_TIMER; | ||
1940 | return scsi_times_out(req); | ||
1941 | } | ||
1942 | |||
1935 | static int scsi_init_request(void *data, struct request *rq, | 1943 | static int scsi_init_request(void *data, struct request *rq, |
1936 | unsigned int hctx_idx, unsigned int request_idx, | 1944 | unsigned int hctx_idx, unsigned int request_idx, |
1937 | unsigned int numa_node) | 1945 | unsigned int numa_node) |
@@ -2043,7 +2051,7 @@ static struct blk_mq_ops scsi_mq_ops = { | |||
2043 | .map_queue = blk_mq_map_queue, | 2051 | .map_queue = blk_mq_map_queue, |
2044 | .queue_rq = scsi_queue_rq, | 2052 | .queue_rq = scsi_queue_rq, |
2045 | .complete = scsi_softirq_done, | 2053 | .complete = scsi_softirq_done, |
2046 | .timeout = scsi_times_out, | 2054 | .timeout = scsi_timeout, |
2047 | .init_request = scsi_init_request, | 2055 | .init_request = scsi_init_request, |
2048 | .exit_request = scsi_exit_request, | 2056 | .exit_request = scsi_exit_request, |
2049 | }; | 2057 | }; |
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 0eb0f642be4b..325349559fb0 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h | |||
@@ -79,6 +79,7 @@ struct blk_mq_tag_set { | |||
79 | 79 | ||
80 | typedef int (queue_rq_fn)(struct blk_mq_hw_ctx *, struct request *, bool); | 80 | typedef int (queue_rq_fn)(struct blk_mq_hw_ctx *, struct request *, bool); |
81 | typedef struct blk_mq_hw_ctx *(map_queue_fn)(struct request_queue *, const int); | 81 | typedef struct blk_mq_hw_ctx *(map_queue_fn)(struct request_queue *, const int); |
82 | typedef enum blk_eh_timer_return (timeout_fn)(struct request *, bool); | ||
82 | typedef int (init_hctx_fn)(struct blk_mq_hw_ctx *, void *, unsigned int); | 83 | typedef int (init_hctx_fn)(struct blk_mq_hw_ctx *, void *, unsigned int); |
83 | typedef void (exit_hctx_fn)(struct blk_mq_hw_ctx *, unsigned int); | 84 | typedef void (exit_hctx_fn)(struct blk_mq_hw_ctx *, unsigned int); |
84 | typedef int (init_request_fn)(void *, struct request *, unsigned int, | 85 | typedef int (init_request_fn)(void *, struct request *, unsigned int, |
@@ -103,7 +104,7 @@ struct blk_mq_ops { | |||
103 | /* | 104 | /* |
104 | * Called on request timeout | 105 | * Called on request timeout |
105 | */ | 106 | */ |
106 | rq_timed_out_fn *timeout; | 107 | timeout_fn *timeout; |
107 | 108 | ||
108 | softirq_done_fn *complete; | 109 | softirq_done_fn *complete; |
109 | 110 | ||