From 7d7e0f90b70f6c5367c2d1c9a7e87dd228bd0816 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 14 Sep 2016 16:18:54 +0200 Subject: blk-mq: remove ->map_queue All drivers use the default, so provide an inline version of it. If we ever need other queue mapping we can add an optional method back, although supporting will also require major changes to the queue setup code. This provides better code generation, and better debugability as well. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Jens Axboe --- block/blk-mq.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'block/blk-mq.h') diff --git a/block/blk-mq.h b/block/blk-mq.h index 9087b11037b7..ec774bf4aea2 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -52,6 +52,12 @@ extern int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues, const struct cpumask *online_mask); extern int blk_mq_hw_queue_to_node(unsigned int *map, unsigned int); +static inline struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *q, + int cpu) +{ + return q->queue_hw_ctx[q->mq_map[cpu]]; +} + /* * sysfs helpers */ -- cgit From da695ba236b993f07a540d35c17f271ef08c89f3 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 14 Sep 2016 16:18:55 +0200 Subject: blk-mq: allow the driver to pass in a queue mapping This allows drivers specify their own queue mapping by overriding the setup-time function that builds the mq_map. This can be used for example to build the map based on the MSI-X vector mapping provided by the core interrupt layer for PCI devices. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Jens Axboe --- block/blk-mq.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'block/blk-mq.h') diff --git a/block/blk-mq.h b/block/blk-mq.h index ec774bf4aea2..c92bb7debf85 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -47,9 +47,7 @@ void blk_mq_disable_hotplug(void); /* * CPU -> queue mappings */ -extern unsigned int *blk_mq_make_queue_map(struct blk_mq_tag_set *set); -extern int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues, - const struct cpumask *online_mask); +int blk_mq_map_queues(struct blk_mq_tag_set *set); extern int blk_mq_hw_queue_to_node(unsigned int *map, unsigned int); static inline struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *q, -- cgit