summaryrefslogtreecommitdiffstats
path: root/block/blk-mq-cpumap.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-05-28 09:50:26 -0600
committerJens Axboe <axboe@fb.com>2014-05-28 09:50:26 -0600
commit6178976500ae61fa7b12ebb2d3de816dc9396388 (patch)
tree143df1479f56458801b676d038e6a7157a472981 /block/blk-mq-cpumap.c
parent6314a108ec19aefa5160535b2bfe1ca9c38efe37 (diff)
parentd852564f8c88b0604490234fdeeb6fb47e4bcc7a (diff)
Merge branch 'for-3.16/core' into for-3.16/drivers
mtip32xx uses blk_mq_alloc_reserved_request(), so pull in the core changes so we have a properly merged end result. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq-cpumap.c')
-rw-r--r--block/blk-mq-cpumap.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c
index 5d0f93cf358..0daacb927be 100644
--- a/block/blk-mq-cpumap.c
+++ b/block/blk-mq-cpumap.c
@@ -96,3 +96,19 @@ unsigned int *blk_mq_make_queue_map(struct blk_mq_tag_set *set)
kfree(map);
return NULL;
}
+
+/*
+ * We have no quick way of doing reverse lookups. This is only used at
+ * queue init time, so runtime isn't important.
+ */
+int blk_mq_hw_queue_to_node(unsigned int *mq_map, unsigned int index)
+{
+ int i;
+
+ for_each_possible_cpu(i) {
+ if (index == mq_map[i])
+ return cpu_to_node(i);
+ }
+
+ return NUMA_NO_NODE;
+}