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>
This commit is contained in:
parent
e4043dcf30
commit
cb2da43e3d
1 changed files with 2 additions and 6 deletions
|
@ -246,16 +246,12 @@ static ssize_t blk_mq_hw_sysfs_tags_show(struct blk_mq_hw_ctx *hctx, char *page)
|
||||||
|
|
||||||
static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page)
|
static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page)
|
||||||
{
|
{
|
||||||
unsigned int i, queue_num, first = 1;
|
unsigned int i, first = 1;
|
||||||
ssize_t ret = 0;
|
ssize_t ret = 0;
|
||||||
|
|
||||||
blk_mq_disable_hotplug();
|
blk_mq_disable_hotplug();
|
||||||
|
|
||||||
for_each_online_cpu(i) {
|
for_each_cpu(i, hctx->cpumask) {
|
||||||
queue_num = hctx->queue->mq_map[i];
|
|
||||||
if (queue_num != hctx->queue_num)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (first)
|
if (first)
|
||||||
ret += sprintf(ret + page, "%u", i);
|
ret += sprintf(ret + page, "%u", i);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue