From 0da73d00ca111a6175825a00d94dbeae185f6d7e Mon Sep 17 00:00:00 2001 From: Minwoo Im Date: Mon, 2 Jul 2018 23:46:43 +0900 Subject: blk-mq: code clean-up by adding an API to clear set->mq_map set->mq_map is now currently cleared if something goes wrong when establishing a queue map in blk-mq-pci.c. It's also cleared before updating a queue map in blk_mq_update_queue_map(). This patch provides an API to clear set->mq_map to make it clear. Signed-off-by: Minwoo Im Signed-off-by: Jens Axboe --- block/blk-mq.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'block/blk-mq.h') diff --git a/block/blk-mq.h b/block/blk-mq.h index 23659f41bf2c..bc2b24735ed4 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -202,4 +202,12 @@ static inline void blk_mq_put_driver_tag(struct request *rq) __blk_mq_put_driver_tag(hctx, rq); } +static inline void blk_mq_clear_mq_map(struct blk_mq_tag_set *set) +{ + int cpu; + + for_each_possible_cpu(cpu) + set->mq_map[cpu] = 0; +} + #endif -- cgit v1.2.3