aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-08-08 20:11:26 -0400
committerTejun Heo <tj@kernel.org>2013-08-08 20:11:26 -0400
commit0942eeeef68f9493c1bcb1a52baf612b73fcf9fb (patch)
treed4cbfc6cf3bce4850669fa976ecc00acf01163e4 /include
parentd515876e9d951d8cf7fc7c90db2967664bdc89ee (diff)
cgroup: rename cgroup_iter to cgroup_task_iter
cgroup now has multiple iterators and it's quite confusing to have something which walks over tasks of a single cgroup named cgroup_iter. Let's rename it to cgroup_task_iter. While at it, reformat / update comments and replace the overview comment above the interface function decls with proper function comments. Such overview can be useful but function comments should be more than enough here. This is pure rename and doesn't introduce any functional changes. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Matt Helsley <matthltc@us.ibm.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Balbir Singh <bsingharora@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/cgroup.h31
1 files changed, 8 insertions, 23 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 4bc22f4a1abb..ea439794bd9b 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -889,31 +889,16 @@ css_next_descendant_post(struct cgroup_subsys_state *pos,
889 for ((pos) = css_next_descendant_post(NULL, (css)); (pos); \ 889 for ((pos) = css_next_descendant_post(NULL, (css)); (pos); \
890 (pos) = css_next_descendant_post((pos), (css))) 890 (pos) = css_next_descendant_post((pos), (css)))
891 891
892/* A cgroup_iter should be treated as an opaque object */ 892/* A cgroup_task_iter should be treated as an opaque object */
893struct cgroup_iter { 893struct cgroup_task_iter {
894 struct list_head *cset_link; 894 struct list_head *cset_link;
895 struct list_head *task; 895 struct list_head *task;
896}; 896};
897 897
898/* 898void cgroup_task_iter_start(struct cgroup *cgrp, struct cgroup_task_iter *it);
899 * To iterate across the tasks in a cgroup: 899struct task_struct *cgroup_task_iter_next(struct cgroup *cgrp,
900 * 900 struct cgroup_task_iter *it);
901 * 1) call cgroup_iter_start to initialize an iterator 901void cgroup_task_iter_end(struct cgroup *cgrp, struct cgroup_task_iter *it);
902 *
903 * 2) call cgroup_iter_next() to retrieve member tasks until it
904 * returns NULL or until you want to end the iteration
905 *
906 * 3) call cgroup_iter_end() to destroy the iterator.
907 *
908 * Or, call cgroup_scan_tasks() to iterate through every task in a
909 * cgroup - cgroup_scan_tasks() holds the css_set_lock when calling
910 * the test_task() callback, but not while calling the process_task()
911 * callback.
912 */
913void cgroup_iter_start(struct cgroup *cgrp, struct cgroup_iter *it);
914struct task_struct *cgroup_iter_next(struct cgroup *cgrp,
915 struct cgroup_iter *it);
916void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it);
917int cgroup_scan_tasks(struct cgroup_scanner *scan); 902int cgroup_scan_tasks(struct cgroup_scanner *scan);
918int cgroup_attach_task_all(struct task_struct *from, struct task_struct *); 903int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
919int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); 904int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);