summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-11-24 17:58:53 -0500
committerJens Axboe <axboe@fb.com>2015-11-24 17:58:53 -0500
commit3b627a3f934c493ada71217f14681e5157e95783 (patch)
tree930a9fd9f1161a949385d6af04a4b94ae3794327 /block
parentbd5cecea43ef379e82250addd0303e2f9ede6793 (diff)
block: clarify blk_add_timer() use case for blk-mq
Just a comment update on not needing queue_lock, and that we aren't really adding the request to a timeout list for !mq. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-timeout.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index aa40aa93381b..3610af561748 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -186,6 +186,7 @@ unsigned long blk_rq_timeout(unsigned long timeout)
186 * Notes: 186 * Notes:
187 * Each request has its own timer, and as it is added to the queue, we 187 * Each request has its own timer, and as it is added to the queue, we
188 * set up the timer. When the request completes, we cancel the timer. 188 * set up the timer. When the request completes, we cancel the timer.
189 * Queue lock must be held for the non-mq case, mq case doesn't care.
189 */ 190 */
190void blk_add_timer(struct request *req) 191void blk_add_timer(struct request *req)
191{ 192{
@@ -209,6 +210,11 @@ void blk_add_timer(struct request *req)
209 req->timeout = q->rq_timeout; 210 req->timeout = q->rq_timeout;
210 211
211 req->deadline = jiffies + req->timeout; 212 req->deadline = jiffies + req->timeout;
213
214 /*
215 * Only the non-mq case needs to add the request to a protected list.
216 * For the mq case we simply scan the tag map.
217 */
212 if (!q->mq_ops) 218 if (!q->mq_ops)
213 list_add_tail(&req->timeout_list, &req->q->timeout_list); 219 list_add_tail(&req->timeout_list, &req->q->timeout_list);
214 220