aboutsummaryrefslogtreecommitdiff
path: root/block/blk-mq.h
diff options
context:
space:
mode:
authorMinwoo Im2018-07-02 23:46:43 +0900
committerJens Axboe2018-07-09 09:07:53 -0600
commit0da73d00ca111a6175825a00d94dbeae185f6d7e (patch)
tree9885b0b946b98ecf4b4ea37d62b8e507df5f8a52 /block/blk-mq.h
parent5efac89c849849ad3a959224eb711f9c311e5bde (diff)
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 <minwoo.im.dev@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.h')
-rw-r--r--block/blk-mq.h8
1 files changed, 8 insertions, 0 deletions
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