aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-08-08 20:11:27 -0400
committerTejun Heo <tj@kernel.org>2013-08-08 20:11:27 -0400
commitd99c8727e7bbc01b70e2c57e6127bfab26b868fd (patch)
tree9479ba1329ac1184cf82755ade7dfe94e9d7a4be /include/linux
parent81eeaf0411204f52af8ef78ff107cfca2fcfec1d (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 'include/linux')
-rw-r--r--include/linux/cgroup.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index b065d24486e6..d9a970568be9 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -562,20 +562,22 @@ int cgroup_task_count(const struct cgroup *cgrp);
562struct cgroup_taskset; 562struct cgroup_taskset;
563struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset); 563struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset);
564struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset); 564struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset);
565struct cgroup *cgroup_taskset_cur_cgroup(struct cgroup_taskset *tset); 565struct cgroup_subsys_state *cgroup_taskset_cur_css(struct cgroup_taskset *tset,
566 int subsys_id);
566int cgroup_taskset_size(struct cgroup_taskset *tset); 567int cgroup_taskset_size(struct cgroup_taskset *tset);
567 568
568/** 569/**
569 * cgroup_taskset_for_each - iterate cgroup_taskset 570 * cgroup_taskset_for_each - iterate cgroup_taskset
570 * @task: the loop cursor 571 * @task: the loop cursor
571 * @skip_cgrp: skip if task's cgroup matches this, %NULL to iterate through all 572 * @skip_css: skip if task's css matches this, %NULL to iterate through all
572 * @tset: taskset to iterate 573 * @tset: taskset to iterate
573 */ 574 */
574#define cgroup_taskset_for_each(task, skip_cgrp, tset) \ 575#define cgroup_taskset_for_each(task, skip_css, tset) \
575 for ((task) = cgroup_taskset_first((tset)); (task); \ 576 for ((task) = cgroup_taskset_first((tset)); (task); \
576 (task) = cgroup_taskset_next((tset))) \ 577 (task) = cgroup_taskset_next((tset))) \
577 if (!(skip_cgrp) || \ 578 if (!(skip_css) || \
578 cgroup_taskset_cur_cgroup((tset)) != (skip_cgrp)) 579 cgroup_taskset_cur_css((tset), \
580 (skip_css)->ss->subsys_id) != (skip_css))
579 581
580/* 582/*
581 * Control Group subsystem type. 583 * Control Group subsystem type.