diff options
Diffstat (limited to 'include/linux/blk-mq.h')
-rw-r--r-- | include/linux/blk-mq.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index ab0e9b2025b3..161b23105b1e 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h | |||
@@ -113,7 +113,6 @@ enum { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *); | 115 | struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *); |
116 | void blk_mq_free_queue(struct request_queue *); | ||
117 | int blk_mq_register_disk(struct gendisk *); | 116 | int blk_mq_register_disk(struct gendisk *); |
118 | void blk_mq_unregister_disk(struct gendisk *); | 117 | void blk_mq_unregister_disk(struct gendisk *); |
119 | void blk_mq_init_commands(struct request_queue *, void (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); | 118 | void blk_mq_init_commands(struct request_queue *, void (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); |
@@ -159,16 +158,16 @@ static inline struct request *blk_mq_tag_to_rq(struct blk_mq_hw_ctx *hctx, | |||
159 | } | 158 | } |
160 | 159 | ||
161 | #define queue_for_each_hw_ctx(q, hctx, i) \ | 160 | #define queue_for_each_hw_ctx(q, hctx, i) \ |
162 | for ((i) = 0, hctx = (q)->queue_hw_ctx[0]; \ | 161 | for ((i) = 0; (i) < (q)->nr_hw_queues && \ |
163 | (i) < (q)->nr_hw_queues; (i)++, hctx = (q)->queue_hw_ctx[i]) | 162 | ({ hctx = (q)->queue_hw_ctx[i]; 1; }); (i)++) |
164 | 163 | ||
165 | #define queue_for_each_ctx(q, ctx, i) \ | 164 | #define queue_for_each_ctx(q, ctx, i) \ |
166 | for ((i) = 0, ctx = per_cpu_ptr((q)->queue_ctx, 0); \ | 165 | for ((i) = 0; (i) < (q)->nr_queues && \ |
167 | (i) < (q)->nr_queues; (i)++, ctx = per_cpu_ptr(q->queue_ctx, (i))) | 166 | ({ ctx = per_cpu_ptr((q)->queue_ctx, (i)); 1; }); (i)++) |
168 | 167 | ||
169 | #define hctx_for_each_ctx(hctx, ctx, i) \ | 168 | #define hctx_for_each_ctx(hctx, ctx, i) \ |
170 | for ((i) = 0, ctx = (hctx)->ctxs[0]; \ | 169 | for ((i) = 0; (i) < (hctx)->nr_ctx && \ |
171 | (i) < (hctx)->nr_ctx; (i)++, ctx = (hctx)->ctxs[(i)]) | 170 | ({ ctx = (hctx)->ctxs[(i)]; 1; }); (i)++) |
172 | 171 | ||
173 | #define blk_ctx_sum(q, sum) \ | 172 | #define blk_ctx_sum(q, sum) \ |
174 | ({ \ | 173 | ({ \ |