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/cpuset.c | |
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/cpuset.c')
-rw-r--r-- | kernel/cpuset.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 032929f91648..4410ac6a55f1 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1732,12 +1732,10 @@ out_unlock: | |||
1732 | * and since these maps can change value dynamically, one could read | 1732 | * and since these maps can change value dynamically, one could read |
1733 | * gibberish by doing partial reads while a list was changing. | 1733 | * gibberish by doing partial reads while a list was changing. |
1734 | */ | 1734 | */ |
1735 | static int cpuset_common_read_seq_string(struct cgroup_subsys_state *css, | 1735 | static int cpuset_common_seq_show(struct seq_file *sf, void *v) |
1736 | struct cftype *cft, | ||
1737 | struct seq_file *sf) | ||
1738 | { | 1736 | { |
1739 | struct cpuset *cs = css_cs(css); | 1737 | struct cpuset *cs = css_cs(seq_css(sf)); |
1740 | cpuset_filetype_t type = cft->private; | 1738 | cpuset_filetype_t type = seq_cft(sf)->private; |
1741 | ssize_t count; | 1739 | ssize_t count; |
1742 | char *buf, *s; | 1740 | char *buf, *s; |
1743 | int ret = 0; | 1741 | int ret = 0; |
@@ -1824,7 +1822,7 @@ static s64 cpuset_read_s64(struct cgroup_subsys_state *css, struct cftype *cft) | |||
1824 | static struct cftype files[] = { | 1822 | static struct cftype files[] = { |
1825 | { | 1823 | { |
1826 | .name = "cpus", | 1824 | .name = "cpus", |
1827 | .read_seq_string = cpuset_common_read_seq_string, | 1825 | .seq_show = cpuset_common_seq_show, |
1828 | .write_string = cpuset_write_resmask, | 1826 | .write_string = cpuset_write_resmask, |
1829 | .max_write_len = (100U + 6 * NR_CPUS), | 1827 | .max_write_len = (100U + 6 * NR_CPUS), |
1830 | .private = FILE_CPULIST, | 1828 | .private = FILE_CPULIST, |
@@ -1832,7 +1830,7 @@ static struct cftype files[] = { | |||
1832 | 1830 | ||
1833 | { | 1831 | { |
1834 | .name = "mems", | 1832 | .name = "mems", |
1835 | .read_seq_string = cpuset_common_read_seq_string, | 1833 | .seq_show = cpuset_common_seq_show, |
1836 | .write_string = cpuset_write_resmask, | 1834 | .write_string = cpuset_write_resmask, |
1837 | .max_write_len = (100U + 6 * MAX_NUMNODES), | 1835 | .max_write_len = (100U + 6 * MAX_NUMNODES), |
1838 | .private = FILE_MEMLIST, | 1836 | .private = FILE_MEMLIST, |