提交 b03ba65b 编写于 作者: J Jiufei Xue 提交者: Caspar Zhang

alinux: block-throttle: code cleanup

This patch does the code cleanup because the seq_show handlers for tg
counters are the same. No functional changes.
Signed-off-by: NJiufei Xue <jiufei.xue@linux.alibaba.com>
Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Acked-by: NCaspar Zhang <caspar@linux.alibaba.com>
上级 766cfe98
......@@ -1597,31 +1597,7 @@ static u64 tg_prfill_rwstat_field(struct seq_file *sf,
return __blkg_prfill_rwstat(sf, pd, &rwstat);
}
static int tg_print_service_time(struct seq_file *sf, void *v)
{
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
tg_prfill_rwstat_field, &blkcg_policy_throtl,
seq_cft(sf)->private, true);
return 0;
}
static int tg_print_wait_time(struct seq_file *sf, void *v)
{
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
tg_prfill_rwstat_field, &blkcg_policy_throtl,
seq_cft(sf)->private, true);
return 0;
}
static int tg_print_total_bytes_queued(struct seq_file *sf, void *v)
{
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
tg_prfill_rwstat_field, &blkcg_policy_throtl,
seq_cft(sf)->private, true);
return 0;
}
static int tg_print_total_io_queued(struct seq_file *sf, void *v)
static int tg_print_rwstat(struct seq_file *sf, void *v)
{
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
tg_prfill_rwstat_field, &blkcg_policy_throtl,
......@@ -1677,22 +1653,22 @@ static struct cftype throtl_legacy_files[] = {
{
.name = "throttle.io_service_time",
.private = offsetof(struct throtl_grp, service_time),
.seq_show = tg_print_service_time,
.seq_show = tg_print_rwstat,
},
{
.name = "throttle.io_wait_time",
.private = offsetof(struct throtl_grp, wait_time),
.seq_show = tg_print_wait_time,
.seq_show = tg_print_rwstat,
},
{
.name = "throttle.total_bytes_queued",
.private = offsetof(struct throtl_grp, total_bytes_queued),
.seq_show = tg_print_total_bytes_queued,
.seq_show = tg_print_rwstat,
},
{
.name = "throttle.total_io_queued",
.private = offsetof(struct throtl_grp, total_io_queued),
.seq_show = tg_print_total_io_queued,
.seq_show = tg_print_rwstat,
},
{ } /* terminate */
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册