aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup_freezer.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2008-10-29 17:00:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-30 14:38:45 -0400
commit00c2e63c31d0f431952ff2a671c5c6997dd4f8b2 (patch)
tree2277b400fef79e55c13d7045aa63d5bed9ad5883 /kernel/cgroup_freezer.c
parent80a6a2cf3bebcf20285cf05373b9c5ec96816577 (diff)
freezer_cg: use thaw_process() in unfreeze_cgroup()
Don't duplicate the implementation of thaw_process(). [akpm@linux-foundation.org: make __thaw_process() static] Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Cedric Le Goater <clg@fr.ibm.com> Acked-by: Matt Helsley <matthltc@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/cgroup_freezer.c')
-rw-r--r--kernel/cgroup_freezer.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index e9c856a265c9..5e6d26b66e88 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -275,25 +275,18 @@ static int try_to_freeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
275 return num_cant_freeze_now ? -EBUSY : 0; 275 return num_cant_freeze_now ? -EBUSY : 0;
276} 276}
277 277
278static int unfreeze_cgroup(struct cgroup *cgroup, struct freezer *freezer) 278static void unfreeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
279{ 279{
280 struct cgroup_iter it; 280 struct cgroup_iter it;
281 struct task_struct *task; 281 struct task_struct *task;
282 282
283 cgroup_iter_start(cgroup, &it); 283 cgroup_iter_start(cgroup, &it);
284 while ((task = cgroup_iter_next(cgroup, &it))) { 284 while ((task = cgroup_iter_next(cgroup, &it))) {
285 int do_wake; 285 thaw_process(task);
286
287 task_lock(task);
288 do_wake = __thaw_process(task);
289 task_unlock(task);
290 if (do_wake)
291 wake_up_process(task);
292 } 286 }
293 cgroup_iter_end(cgroup, &it); 287 cgroup_iter_end(cgroup, &it);
294 freezer->state = CGROUP_THAWED;
295 288
296 return 0; 289 freezer->state = CGROUP_THAWED;
297} 290}
298 291
299static int freezer_change_state(struct cgroup *cgroup, 292static int freezer_change_state(struct cgroup *cgroup,
@@ -320,7 +313,7 @@ static int freezer_change_state(struct cgroup *cgroup,
320 } 313 }
321 /* state == FREEZING and goal_state == THAWED, so unfreeze */ 314 /* state == FREEZING and goal_state == THAWED, so unfreeze */
322 case CGROUP_FROZEN: 315 case CGROUP_FROZEN:
323 retval = unfreeze_cgroup(cgroup, freezer); 316 unfreeze_cgroup(cgroup, freezer);
324 break; 317 break;
325 default: 318 default:
326 break; 319 break;