aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-mq-sysfs.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-04-09 12:53:21 -0400
committerJens Axboe <axboe@fb.com>2014-04-09 12:53:21 -0400
commitcb2da43e3d02b745408252fe4c447b23b1f4fc7b (patch)
tree478ee0ca7f83132a68f0cd7b1d7f68e7df14450d /block/blk-mq-sysfs.c
parente4043dcf30811f5db15181168e2aac172514302a (diff)
blk-mq: simplify blk_mq_hw_sysfs_cpus_show()
Now that we have a cpu mask of CPUs that are mapped to a specific hardware queue, we can just iterate that to display the sysfs num-hw-queue/cpu_list file. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq-sysfs.c')
-rw-r--r--block/blk-mq-sysfs.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c
index b0ba264b0522..9176a6984857 100644
--- a/block/blk-mq-sysfs.c
+++ b/block/blk-mq-sysfs.c
@@ -246,16 +246,12 @@ static ssize_t blk_mq_hw_sysfs_tags_show(struct blk_mq_hw_ctx *hctx, char *page)
246 246
247static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page) 247static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page)
248{ 248{
249 unsigned int i, queue_num, first = 1; 249 unsigned int i, first = 1;
250 ssize_t ret = 0; 250 ssize_t ret = 0;
251 251
252 blk_mq_disable_hotplug(); 252 blk_mq_disable_hotplug();
253 253
254 for_each_online_cpu(i) { 254 for_each_cpu(i, hctx->cpumask) {
255 queue_num = hctx->queue->mq_map[i];
256 if (queue_num != hctx->queue_num)
257 continue;
258
259 if (first) 255 if (first)
260 ret += sprintf(ret + page, "%u", i); 256 ret += sprintf(ret + page, "%u", i);
261 else 257 else