diff options
author | Tejun Heo <tj@kernel.org> | 2013-08-08 20:11:27 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-08-08 20:11:27 -0400 |
commit | d99c8727e7bbc01b70e2c57e6127bfab26b868fd (patch) | |
tree | 9479ba1329ac1184cf82755ade7dfe94e9d7a4be /kernel/cgroup.c | |
parent | 81eeaf0411204f52af8ef78ff107cfca2fcfec1d (diff) |
cgroup: make cgroup_taskset deal with cgroup_subsys_state instead of cgroup
cgroup is in the process of converting to css (cgroup_subsys_state)
from cgroup as the principal subsystem interface handle. This is
mostly to prepare for the unified hierarchy support where css's will
be created and destroyed dynamically but also helps cleaning up
subsystem implementations as css is usually what they are interested
in anyway.
cgroup_taskset which is used by the subsystem attach methods is the
last cgroup subsystem API which isn't using css as the handle. Update
cgroup_taskset_cur_cgroup() to cgroup_taskset_cur_css() and
cgroup_taskset_for_each() to take @skip_css instead of @skip_cgrp.
The conversions are pretty mechanical. One exception is
cpuset::cgroup_cs(), which lost its last user and got removed.
This patch shouldn't introduce any functional changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Acked-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Matt Helsley <matthltc@us.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index a71f2e0f9711..e5bfb2a81dcb 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -1907,18 +1907,20 @@ struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset) | |||
1907 | EXPORT_SYMBOL_GPL(cgroup_taskset_next); | 1907 | EXPORT_SYMBOL_GPL(cgroup_taskset_next); |
1908 | 1908 | ||
1909 | /** | 1909 | /** |
1910 | * cgroup_taskset_cur_cgroup - return the matching cgroup for the current task | 1910 | * cgroup_taskset_cur_css - return the matching css for the current task |
1911 | * @tset: taskset of interest | 1911 | * @tset: taskset of interest |
1912 | * @subsys_id: the ID of the target subsystem | ||
1912 | * | 1913 | * |
1913 | * Return the cgroup for the current (last returned) task of @tset. This | 1914 | * Return the css for the current (last returned) task of @tset for |
1914 | * function must be preceded by either cgroup_taskset_first() or | 1915 | * subsystem specified by @subsys_id. This function must be preceded by |
1915 | * cgroup_taskset_next(). | 1916 | * either cgroup_taskset_first() or cgroup_taskset_next(). |
1916 | */ | 1917 | */ |
1917 | struct cgroup *cgroup_taskset_cur_cgroup(struct cgroup_taskset *tset) | 1918 | struct cgroup_subsys_state *cgroup_taskset_cur_css(struct cgroup_taskset *tset, |
1919 | int subsys_id) | ||
1918 | { | 1920 | { |
1919 | return tset->cur_cgrp; | 1921 | return cgroup_css(tset->cur_cgrp, subsys_id); |
1920 | } | 1922 | } |
1921 | EXPORT_SYMBOL_GPL(cgroup_taskset_cur_cgroup); | 1923 | EXPORT_SYMBOL_GPL(cgroup_taskset_cur_css); |
1922 | 1924 | ||
1923 | /** | 1925 | /** |
1924 | * cgroup_taskset_size - return the number of tasks in taskset | 1926 | * cgroup_taskset_size - return the number of tasks in taskset |