diff options
author | Tejun Heo <tj@kernel.org> | 2013-12-05 12:28:01 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-12-05 12:28:01 -0500 |
commit | 44ffc75ba9a63f972dbebd4fab6888db5fcd3b0e (patch) | |
tree | 74e59dc41c550c3013e4ed1ec651557f8acfceee /kernel/sched/cpuacct.c | |
parent | afb2bc14e1c989cf0635bd04edb5ff55b8c1c7bd (diff) | |
download | blackbird-op-linux-44ffc75ba9a63f972dbebd4fab6888db5fcd3b0e.tar.gz blackbird-op-linux-44ffc75ba9a63f972dbebd4fab6888db5fcd3b0e.zip |
cgroup, sched: convert away from cftype->read_map()
In preparation of conversion to kernfs, cgroup file handling is being
consolidated so that it can be easily mapped to the seq_file based
interface of kernfs.
cftype->read_map() doesn't add any value and being replaced with
->read_seq_string(). Update cpu_stats_show() and cpuacct_stats_show()
accordingly.
This patch doesn't make any visible behavior changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'kernel/sched/cpuacct.c')
-rw-r--r-- | kernel/sched/cpuacct.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index f64722ff0299..dd88738cd4a9 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c @@ -184,7 +184,7 @@ static const char * const cpuacct_stat_desc[] = { }; static int cpuacct_stats_show(struct cgroup_subsys_state *css, - struct cftype *cft, struct cgroup_map_cb *cb) + struct cftype *cft, struct seq_file *sf) { struct cpuacct *ca = css_ca(css); int cpu; @@ -196,7 +196,7 @@ static int cpuacct_stats_show(struct cgroup_subsys_state *css, val += kcpustat->cpustat[CPUTIME_NICE]; } val = cputime64_to_clock_t(val); - cb->fill(cb, cpuacct_stat_desc[CPUACCT_STAT_USER], val); + seq_printf(sf, "%s %lld\n", cpuacct_stat_desc[CPUACCT_STAT_USER], val); val = 0; for_each_online_cpu(cpu) { @@ -207,7 +207,7 @@ static int cpuacct_stats_show(struct cgroup_subsys_state *css, } val = cputime64_to_clock_t(val); - cb->fill(cb, cpuacct_stat_desc[CPUACCT_STAT_SYSTEM], val); + seq_printf(sf, "%s %lld\n", cpuacct_stat_desc[CPUACCT_STAT_SYSTEM], val); return 0; } @@ -224,7 +224,7 @@ static struct cftype files[] = { }, { .name = "stat", - .read_map = cpuacct_stats_show, + .read_seq_string = cpuacct_stats_show, }, { } /* terminate */ }; |