summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup_freezer.c
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
commitc59cd3d840b1b0a8f996cbbd9132128dcaabbeb9 (patch)
treef2ad31b11b14c00cfaa5327a5a587fae56604866 /kernel/cgroup_freezer.c
parent0942eeeef68f9493c1bcb1a52baf612b73fcf9fb (diff)
downloadop-kernel-dev-c59cd3d840b1b0a8f996cbbd9132128dcaabbeb9.zip
op-kernel-dev-c59cd3d840b1b0a8f996cbbd9132128dcaabbeb9.tar.gz
cgroup: make cgroup_task_iter remember the cgroup being iterated
Currently all cgroup_task_iter functions require @cgrp to be passed in, which is superflous and increases chance of usage error. Make cgroup_task_iter remember the cgroup being iterated and drop @cgrp argument from next and end functions. This patch doesn't introduce any behavior differences. 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 'kernel/cgroup_freezer.c')
-rw-r--r--kernel/cgroup_freezer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index c9177f8..e0ab9bf 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -281,7 +281,7 @@ static void update_if_frozen(struct cgroup_subsys_state *css)
/* are all tasks frozen? */
cgroup_task_iter_start(css->cgroup, &it);
- while ((task = cgroup_task_iter_next(css->cgroup, &it))) {
+ while ((task = cgroup_task_iter_next(&it))) {
if (freezing(task)) {
/*
* freezer_should_skip() indicates that the task
@@ -296,7 +296,7 @@ static void update_if_frozen(struct cgroup_subsys_state *css)
freezer->state |= CGROUP_FROZEN;
out_iter_end:
- cgroup_task_iter_end(css->cgroup, &it);
+ cgroup_task_iter_end(&it);
out_unlock:
spin_unlock_irq(&freezer->lock);
}
@@ -327,9 +327,9 @@ static void freeze_cgroup(struct freezer *freezer)
struct task_struct *task;
cgroup_task_iter_start(cgroup, &it);
- while ((task = cgroup_task_iter_next(cgroup, &it)))
+ while ((task = cgroup_task_iter_next(&it)))
freeze_task(task);
- cgroup_task_iter_end(cgroup, &it);
+ cgroup_task_iter_end(&it);
}
static void unfreeze_cgroup(struct freezer *freezer)
@@ -339,9 +339,9 @@ static void unfreeze_cgroup(struct freezer *freezer)
struct task_struct *task;
cgroup_task_iter_start(cgroup, &it);
- while ((task = cgroup_task_iter_next(cgroup, &it)))
+ while ((task = cgroup_task_iter_next(&it)))
__thaw_task(task);
- cgroup_task_iter_end(cgroup, &it);
+ cgroup_task_iter_end(&it);
}
/**
OpenPOWER on IntegriCloud