diff options
| author | Tejun Heo <tj@kernel.org> | 2013-12-05 12:28:04 -0500 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2013-12-05 12:28:04 -0500 |
| commit | 2da8ca822d49c8b8781800ad155aaa00e7bb5f1a (patch) | |
| tree | 9ec6b0a7a009d76d0c607640eae64d3e9ed666a9 /kernel/sched | |
| parent | 7da112792753d71aed44b918395892a1fc53048a (diff) | |
cgroup: replace cftype->read_seq_string() with cftype->seq_show()
In preparation of conversion to kernfs, cgroup file handling is
updated so that it can be easily mapped to kernfs. This patch
replaces cftype->read_seq_string() with cftype->seq_show() which is
not limited to single_open() operation and will map directcly to
kernfs seq_file interface.
The conversions are mechanical. As ->seq_show() doesn't have @css and
@cft, the functions which make use of them are converted to use
seq_css() and seq_cft() respectively. In several occassions, e.f. if
it has seq_string in its name, the function name is updated to fit the
new method better.
This patch does not introduce any behavior changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Aristeu Rozanski <arozansk@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Diffstat (limited to 'kernel/sched')
| -rw-r--r-- | kernel/sched/core.c | 7 | ||||
| -rw-r--r-- | kernel/sched/cpuacct.c | 14 |
2 files changed, 9 insertions, 12 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f28ec6722f0b..7e8cbb9ee4d6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -7256,10 +7256,9 @@ static int __cfs_schedulable(struct task_group *tg, u64 period, u64 quota) | |||
| 7256 | return ret; | 7256 | return ret; |
| 7257 | } | 7257 | } |
| 7258 | 7258 | ||
| 7259 | static int cpu_stats_show(struct cgroup_subsys_state *css, struct cftype *cft, | 7259 | static int cpu_stats_show(struct seq_file *sf, void *v) |
| 7260 | struct seq_file *sf) | ||
| 7261 | { | 7260 | { |
| 7262 | struct task_group *tg = css_tg(css); | 7261 | struct task_group *tg = css_tg(seq_css(sf)); |
| 7263 | struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; | 7262 | struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; |
| 7264 | 7263 | ||
| 7265 | seq_printf(sf, "nr_periods %d\n", cfs_b->nr_periods); | 7264 | seq_printf(sf, "nr_periods %d\n", cfs_b->nr_periods); |
| @@ -7318,7 +7317,7 @@ static struct cftype cpu_files[] = { | |||
| 7318 | }, | 7317 | }, |
| 7319 | { | 7318 | { |
| 7320 | .name = "stat", | 7319 | .name = "stat", |
| 7321 | .read_seq_string = cpu_stats_show, | 7320 | .seq_show = cpu_stats_show, |
| 7322 | }, | 7321 | }, |
| 7323 | #endif | 7322 | #endif |
| 7324 | #ifdef CONFIG_RT_GROUP_SCHED | 7323 | #ifdef CONFIG_RT_GROUP_SCHED |
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index dd88738cd4a9..622e0818f905 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c | |||
| @@ -163,10 +163,9 @@ out: | |||
| 163 | return err; | 163 | return err; |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | static int cpuacct_percpu_seq_read(struct cgroup_subsys_state *css, | 166 | static int cpuacct_percpu_seq_show(struct seq_file *m, void *V) |
| 167 | struct cftype *cft, struct seq_file *m) | ||
| 168 | { | 167 | { |
| 169 | struct cpuacct *ca = css_ca(css); | 168 | struct cpuacct *ca = css_ca(seq_css(m)); |
| 170 | u64 percpu; | 169 | u64 percpu; |
| 171 | int i; | 170 | int i; |
| 172 | 171 | ||
| @@ -183,10 +182,9 @@ static const char * const cpuacct_stat_desc[] = { | |||
| 183 | [CPUACCT_STAT_SYSTEM] = "system", | 182 | [CPUACCT_STAT_SYSTEM] = "system", |
| 184 | }; | 183 | }; |
| 185 | 184 | ||
| 186 | static int cpuacct_stats_show(struct cgroup_subsys_state *css, | 185 | static int cpuacct_stats_show(struct seq_file *sf, void *v) |
| 187 | struct cftype *cft, struct seq_file *sf) | ||
| 188 | { | 186 | { |
| 189 | struct cpuacct *ca = css_ca(css); | 187 | struct cpuacct *ca = css_ca(seq_css(sf)); |
| 190 | int cpu; | 188 | int cpu; |
| 191 | s64 val = 0; | 189 | s64 val = 0; |
| 192 | 190 | ||
| @@ -220,11 +218,11 @@ static struct cftype files[] = { | |||
| 220 | }, | 218 | }, |
| 221 | { | 219 | { |
| 222 | .name = "usage_percpu", | 220 | .name = "usage_percpu", |
| 223 | .read_seq_string = cpuacct_percpu_seq_read, | 221 | .seq_show = cpuacct_percpu_seq_show, |
| 224 | }, | 222 | }, |
| 225 | { | 223 | { |
| 226 | .name = "stat", | 224 | .name = "stat", |
| 227 | .read_seq_string = cpuacct_stats_show, | 225 | .seq_show = cpuacct_stats_show, |
| 228 | }, | 226 | }, |
| 229 | { } /* terminate */ | 227 | { } /* terminate */ |
| 230 | }; | 228 | }; |
