Commit 1aece348 authored by Matt Helsley's avatar Matt Helsley Committed by Linus Torvalds

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: default avatarMatt Helsley <matthltc@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 81dcf33c
...@@ -201,8 +201,8 @@ static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task) ...@@ -201,8 +201,8 @@ static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task)
/* /*
* caller must hold freezer->lock * caller must hold freezer->lock
*/ */
static void check_if_frozen(struct cgroup *cgroup, static void update_freezer_state(struct cgroup *cgroup,
struct freezer *freezer) struct freezer *freezer)
{ {
struct cgroup_iter it; struct cgroup_iter it;
struct task_struct *task; struct task_struct *task;
...@@ -222,6 +222,10 @@ static void check_if_frozen(struct cgroup *cgroup, ...@@ -222,6 +222,10 @@ static void check_if_frozen(struct cgroup *cgroup,
*/ */
if (nfrozen == ntotal) if (nfrozen == ntotal)
freezer->state = CGROUP_FROZEN; freezer->state = CGROUP_FROZEN;
else if (nfrozen > 0)
freezer->state = CGROUP_FREEZING;
else
freezer->state = CGROUP_THAWED;
cgroup_iter_end(cgroup, &it); cgroup_iter_end(cgroup, &it);
} }
...@@ -240,7 +244,7 @@ static int freezer_read(struct cgroup *cgroup, struct cftype *cft, ...@@ -240,7 +244,7 @@ static int freezer_read(struct cgroup *cgroup, struct cftype *cft,
if (state == CGROUP_FREEZING) { if (state == CGROUP_FREEZING) {
/* We change from FREEZING to FROZEN lazily if the cgroup was /* We change from FREEZING to FROZEN lazily if the cgroup was
* only partially frozen when we exitted write. */ * only partially frozen when we exitted write. */
check_if_frozen(cgroup, freezer); update_freezer_state(cgroup, freezer);
state = freezer->state; state = freezer->state;
} }
spin_unlock_irq(&freezer->lock); spin_unlock_irq(&freezer->lock);
...@@ -301,7 +305,7 @@ static int freezer_change_state(struct cgroup *cgroup, ...@@ -301,7 +305,7 @@ static int freezer_change_state(struct cgroup *cgroup,
freezer = cgroup_freezer(cgroup); freezer = cgroup_freezer(cgroup);
spin_lock_irq(&freezer->lock); spin_lock_irq(&freezer->lock);
check_if_frozen(cgroup, freezer); /* may update freezer->state */ update_freezer_state(cgroup, freezer);
if (goal_state == freezer->state) if (goal_state == freezer->state)
goto out; goto out;
switch (freezer->state) { switch (freezer->state) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment