aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blk-mq.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-09-13 19:40:11 -0400
committerJens Axboe <axboe@fb.com>2014-09-22 14:00:07 -0400
commit81481eb423c295c5480a3fab9bb961cf286c91e7 (patch)
tree3d4f0eaed9f784ba5beb41aa9fec3e76b867c1e8 /include/linux/blk-mq.h
parentc8a446ad695ada43a885ec12b38411dbd190a11b (diff)
blk-mq: fix and simplify tag iteration for the timeout handler
Don't do a kmalloc from timer to handle timeouts, chances are we could be under heavy load or similar and thus just miss out on the timeouts. Fortunately it is very easy to just iterate over all in use tags, and doing this properly actually cleans up the blk_mq_busy_iter API as well, and prepares us for the next patch by passing a reserved argument to the iterator. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/blk-mq.h')
-rw-r--r--include/linux/blk-mq.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index cb217c16990d..0eb0f642be4b 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -86,6 +86,9 @@ typedef int (init_request_fn)(void *, struct request *, unsigned int,
86typedef void (exit_request_fn)(void *, struct request *, unsigned int, 86typedef void (exit_request_fn)(void *, struct request *, unsigned int,
87 unsigned int); 87 unsigned int);
88 88
89typedef void (busy_iter_fn)(struct blk_mq_hw_ctx *, struct request *, void *,
90 bool);
91
89struct blk_mq_ops { 92struct blk_mq_ops {
90 /* 93 /*
91 * Queue request 94 * Queue request
@@ -174,7 +177,8 @@ void blk_mq_stop_hw_queues(struct request_queue *q);
174void blk_mq_start_hw_queues(struct request_queue *q); 177void blk_mq_start_hw_queues(struct request_queue *q);
175void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async); 178void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async);
176void blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs); 179void blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs);
177void blk_mq_tag_busy_iter(struct blk_mq_tags *tags, void (*fn)(void *data, unsigned long *), void *data); 180void blk_mq_tag_busy_iter(struct blk_mq_hw_ctx *hctx, busy_iter_fn *fn,
181 void *priv);
178 182
179/* 183/*
180 * Driver command data is immediately after the request. So subtract request 184 * Driver command data is immediately after the request. So subtract request