diff options
author | Tejun Heo <tj@kernel.org> | 2013-08-08 20:11:26 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-08-08 20:11:26 -0400 |
commit | c59cd3d840b1b0a8f996cbbd9132128dcaabbeb9 (patch) | |
tree | f2ad31b11b14c00cfaa5327a5a587fae56604866 /kernel/cgroup_freezer.c | |
parent | 0942eeeef68f9493c1bcb1a52baf612b73fcf9fb (diff) |
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.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index c9177f8fc661..e0ab9bfd679a 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) | |||
281 | /* are all tasks frozen? */ | 281 | /* are all tasks frozen? */ |
282 | cgroup_task_iter_start(css->cgroup, &it); | 282 | cgroup_task_iter_start(css->cgroup, &it); |
283 | 283 | ||
284 | while ((task = cgroup_task_iter_next(css->cgroup, &it))) { | 284 | while ((task = cgroup_task_iter_next(&it))) { |
285 | if (freezing(task)) { | 285 | if (freezing(task)) { |
286 | /* | 286 | /* |
287 | * freezer_should_skip() indicates that the task | 287 | * freezer_should_skip() indicates that the task |
@@ -296,7 +296,7 @@ static void update_if_frozen(struct cgroup_subsys_state *css) | |||
296 | 296 | ||
297 | freezer->state |= CGROUP_FROZEN; | 297 | freezer->state |= CGROUP_FROZEN; |
298 | out_iter_end: | 298 | out_iter_end: |
299 | cgroup_task_iter_end(css->cgroup, &it); | 299 | cgroup_task_iter_end(&it); |
300 | out_unlock: | 300 | out_unlock: |
301 | spin_unlock_irq(&freezer->lock); | 301 | spin_unlock_irq(&freezer->lock); |
302 | } | 302 | } |
@@ -327,9 +327,9 @@ static void freeze_cgroup(struct freezer *freezer) | |||
327 | struct task_struct *task; | 327 | struct task_struct *task; |
328 | 328 | ||
329 | cgroup_task_iter_start(cgroup, &it); | 329 | cgroup_task_iter_start(cgroup, &it); |
330 | while ((task = cgroup_task_iter_next(cgroup, &it))) | 330 | while ((task = cgroup_task_iter_next(&it))) |
331 | freeze_task(task); | 331 | freeze_task(task); |
332 | cgroup_task_iter_end(cgroup, &it); | 332 | cgroup_task_iter_end(&it); |
333 | } | 333 | } |
334 | 334 | ||
335 | static void unfreeze_cgroup(struct freezer *freezer) | 335 | static void unfreeze_cgroup(struct freezer *freezer) |
@@ -339,9 +339,9 @@ static void unfreeze_cgroup(struct freezer *freezer) | |||
339 | struct task_struct *task; | 339 | struct task_struct *task; |
340 | 340 | ||
341 | cgroup_task_iter_start(cgroup, &it); | 341 | cgroup_task_iter_start(cgroup, &it); |
342 | while ((task = cgroup_task_iter_next(cgroup, &it))) | 342 | while ((task = cgroup_task_iter_next(&it))) |
343 | __thaw_task(task); | 343 | __thaw_task(task); |
344 | cgroup_task_iter_end(cgroup, &it); | 344 | cgroup_task_iter_end(&it); |
345 | } | 345 | } |
346 | 346 | ||
347 | /** | 347 | /** |