Skip to content

Commit cb2da43

Browse files
committed
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>
1 parent e4043dc commit cb2da43

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎block/blk-mq-sysfs.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,12 @@ static ssize_t blk_mq_hw_sysfs_tags_show(struct blk_mq_hw_ctx *hctx, char *page)
246246

247247
static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page)
248248
{
249-
unsigned int i, queue_num, first = 1;
249+
unsigned int i, first = 1;
250250
ssize_t ret = 0;
251251

252252
blk_mq_disable_hotplug();
253253

254-
for_each_online_cpu(i) {
255-
queue_num = hctx->queue->mq_map[i];
256-
if (queue_num != hctx->queue_num)
257-
continue;
258-
254+
for_each_cpu(i, hctx->cpumask) {
259255
if (first)
260256
ret += sprintf(ret + page, "%u", i);
261257
else

0 commit comments

Comments
 (0)