From b03ba65b34ce588c564da3f2145ffbe69b3d1ad1 Mon Sep 17 00:00:00 2001 From: Jiufei Xue Date: Tue, 10 Apr 2018 16:38:26 +0800 Subject: [PATCH] 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: Jiufei Xue Signed-off-by: Joseph Qi Acked-by: Caspar Zhang --- block/blk-throttle.c | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 781ef2f94895..11360b90161a 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -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 */ }; -- GitLab