summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup_freezer.c
diff options
context:
space:
mode:
authorMatt Helsley <matthltc@us.ibm.com>2008-10-18 20:27:24 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 08:52:34 -0700
commit1aece34833721d64eb33fc15cd923c727296d3d3 (patch)
tree7d50bac9229430528ff28aa362c87f745ebd1c78 /kernel/cgroup_freezer.c
parent81dcf33c2ae314899f754aa7aaa1cb1fe2f84da6 (diff)
downloadlinux-1aece34833721d64eb33fc15cd923c727296d3d3.tar.gz
linux-1aece34833721d64eb33fc15cd923c727296d3d3.tar.bz2
linux-1aece34833721d64eb33fc15cd923c727296d3d3.zip
container freezer: rename check_if_frozen()
check_if_frozen() sounds like it should return something when in fact it's just updating the freezer state. Signed-off-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.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 6e4280d77429..e95056954498 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -201,8 +201,8 @@ static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task)
/*
* caller must hold freezer->lock
*/
-static void check_if_frozen(struct cgroup *cgroup,
- struct freezer *freezer)
+static void update_freezer_state(struct cgroup *cgroup,
+ struct freezer *freezer)
{
struct cgroup_iter it;
struct task_struct *task;
@@ -222,6 +222,10 @@ static void check_if_frozen(struct cgroup *cgroup,
*/
if (nfrozen == ntotal)
freezer->state = CGROUP_FROZEN;
+ else if (nfrozen > 0)
+ freezer->state = CGROUP_FREEZING;
+ else
+ freezer->state = CGROUP_THAWED;
cgroup_iter_end(cgroup, &it);
}
@@ -240,7 +244,7 @@ static int freezer_read(struct cgroup *cgroup, struct cftype *cft,
if (state == CGROUP_FREEZING) {
/* We change from FREEZING to FROZEN lazily if the cgroup was
* only partially frozen when we exitted write. */
- check_if_frozen(cgroup, freezer);
+ update_freezer_state(cgroup, freezer);
state = freezer->state;
}
spin_unlock_irq(&freezer->lock);
@@ -301,7 +305,7 @@ static int freezer_change_state(struct cgroup *cgroup,
freezer = cgroup_freezer(cgroup);
spin_lock_irq(&freezer->lock);
- check_if_frozen(cgroup, freezer); /* may update freezer->state */
+ update_freezer_state(cgroup, freezer);
if (goal_state == freezer->state)
goto out;
switch (freezer->state) {