Skip to content

Commit a557f1c

Browse files
htejunaxboe
authored andcommitted
bfq-iosched: relocate bfqg_*rwstat*() helpers
Collect them right under #ifdef CONFIG_BFQ_CGROUP_DEBUG. The next patch will use them from !DEBUG path and this makes it easy to move them out of the ifdef block. This is pure code reorganization. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 912c0a8 commit a557f1c

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

‎block/bfq-cgroup.c‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,17 +1058,34 @@ static ssize_t bfq_io_set_weight(struct kernfs_open_file *of,
10581058
}
10591059

10601060
#ifdef CONFIG_BFQ_CGROUP_DEBUG
1061-
static int bfqg_print_stat(struct seq_file *sf, void *v)
1061+
static int bfqg_print_rwstat(struct seq_file *sf, void *v)
10621062
{
1063-
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), blkg_prfill_stat,
1064-
&blkcg_policy_bfq, seq_cft(sf)->private, false);
1063+
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), blkg_prfill_rwstat,
1064+
&blkcg_policy_bfq, seq_cft(sf)->private, true);
10651065
return 0;
10661066
}
10671067

1068-
static int bfqg_print_rwstat(struct seq_file *sf, void *v)
1068+
static u64 bfqg_prfill_rwstat_recursive(struct seq_file *sf,
1069+
struct blkg_policy_data *pd, int off)
10691070
{
1070-
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), blkg_prfill_rwstat,
1071-
&blkcg_policy_bfq, seq_cft(sf)->private, true);
1071+
struct blkg_rwstat_sample sum;
1072+
1073+
blkg_rwstat_recursive_sum(pd_to_blkg(pd), &blkcg_policy_bfq, off, &sum);
1074+
return __blkg_prfill_rwstat(sf, pd, &sum);
1075+
}
1076+
1077+
static int bfqg_print_rwstat_recursive(struct seq_file *sf, void *v)
1078+
{
1079+
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
1080+
bfqg_prfill_rwstat_recursive, &blkcg_policy_bfq,
1081+
seq_cft(sf)->private, true);
1082+
return 0;
1083+
}
1084+
1085+
static int bfqg_print_stat(struct seq_file *sf, void *v)
1086+
{
1087+
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), blkg_prfill_stat,
1088+
&blkcg_policy_bfq, seq_cft(sf)->private, false);
10721089
return 0;
10731090
}
10741091

@@ -1097,15 +1114,6 @@ static u64 bfqg_prfill_stat_recursive(struct seq_file *sf,
10971114
return __blkg_prfill_u64(sf, pd, sum);
10981115
}
10991116

1100-
static u64 bfqg_prfill_rwstat_recursive(struct seq_file *sf,
1101-
struct blkg_policy_data *pd, int off)
1102-
{
1103-
struct blkg_rwstat_sample sum;
1104-
1105-
blkg_rwstat_recursive_sum(pd_to_blkg(pd), &blkcg_policy_bfq, off, &sum);
1106-
return __blkg_prfill_rwstat(sf, pd, &sum);
1107-
}
1108-
11091117
static int bfqg_print_stat_recursive(struct seq_file *sf, void *v)
11101118
{
11111119
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
@@ -1114,14 +1122,6 @@ static int bfqg_print_stat_recursive(struct seq_file *sf, void *v)
11141122
return 0;
11151123
}
11161124

1117-
static int bfqg_print_rwstat_recursive(struct seq_file *sf, void *v)
1118-
{
1119-
blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
1120-
bfqg_prfill_rwstat_recursive, &blkcg_policy_bfq,
1121-
seq_cft(sf)->private, true);
1122-
return 0;
1123-
}
1124-
11251125
static u64 bfqg_prfill_sectors(struct seq_file *sf, struct blkg_policy_data *pd,
11261126
int off)
11271127
{

0 commit comments

Comments
 (0)