summaryrefslogtreecommitdiff
path: root/block/blk-iocost.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-09-21 20:04:53 +0200
committerJens Axboe <axboe@kernel.dk>2022-09-26 19:17:27 -0600
commit9df3e65139b923dfe98f76b7057882c7afb2d3e4 (patch)
tree79e3e4c0dbb2b6c4c60192547ed56865cf9ecc1d /block/blk-iocost.c
parent16fac1b5912b778a30d8863dbc928bef25c8d307 (diff)
downloadlinux-rpi-9df3e65139b923dfe98f76b7057882c7afb2d3e4.tar.gz
linux-rpi-9df3e65139b923dfe98f76b7057882c7afb2d3e4.tar.bz2
linux-rpi-9df3e65139b923dfe98f76b7057882c7afb2d3e4.zip
blk-iocost: simplify ioc_name
Just directly dereference the disk name instead of going through multiple hoops to find the same value. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Andreas Herrmann <aherrmann@suse.de> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20220921180501.1539876-10-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-iocost.c')
-rw-r--r--block/blk-iocost.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index b473efd89b86..d0d9b2d17508 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -664,17 +664,13 @@ static struct ioc *q_to_ioc(struct request_queue *q)
return rqos_to_ioc(rq_qos_id(q, RQ_QOS_COST));
}
-static const char *q_name(struct request_queue *q)
-{
- if (blk_queue_registered(q))
- return kobject_name(q->kobj.parent);
- else
- return "<unknown>";
-}
-
static const char __maybe_unused *ioc_name(struct ioc *ioc)
{
- return q_name(ioc->rqos.q);
+ struct gendisk *disk = ioc->rqos.q->disk;
+
+ if (!disk)
+ return "<unknown>";
+ return disk->disk_name;
}
static struct ioc_gq *pd_to_iocg(struct blkg_policy_data *pd)