diff mbox series

[4/5] blk-iolatency: use new helper blkg_print_dev_name()

Message ID 20240930085302.1558217-5-yukuai1@huaweicloud.com (mailing list archive)
State New, archived
Headers show
Series blk-cgroup: don't abuse bdi in blk-cgroup | expand

Commit Message

Yu Kuai Sept. 30, 2024, 8:53 a.m. UTC
From: Yu Kuai <yukuai3@huawei.com>

To avoid abuse of bdi_dev_name().

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 block/blk-iolatency.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c
index ebb522788d97..9c9ab4a73e0b 100644
--- a/block/blk-iolatency.c
+++ b/block/blk-iolatency.c
@@ -898,12 +898,15 @@  static u64 iolatency_prfill_limit(struct seq_file *sf,
 				  struct blkg_policy_data *pd, int off)
 {
 	struct iolatency_grp *iolat = pd_to_lat(pd);
-	const char *dname = blkg_dev_name(pd->blkg);
 
-	if (!dname || !iolat->min_lat_nsec)
+	if (!iolat->min_lat_nsec)
 		return 0;
-	seq_printf(sf, "%s target=%llu\n",
-		   dname, div_u64(iolat->min_lat_nsec, NSEC_PER_USEC));
+
+	if (!blkg_print_dev_name(sf, pd->blkg))
+		return 0;
+
+	seq_printf(sf, " target=%llu\n",
+		   div_u64(iolat->min_lat_nsec, NSEC_PER_USEC));
 	return 0;
 }