[Devel] [PATCH] Remove update_freezer_state()

Matt Helsley matthltc at us.ibm.com
Thu Jan 27 05:14:20 PST 2011


update_freezer_state() was renamed to update_if_frozen(). Use the
newly name of the function and remove the old copy.

Signed-off-by: Matt Helsley <matthltc at us.ibm.com>
---
 kernel/cgroup_freezer.c |   33 +--------------------------------
 1 files changed, 1 insertions(+), 32 deletions(-)

diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 507cb43..2691bd8 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -72,37 +72,6 @@ static bool is_task_frozen_enough(struct task_struct *task)
 }
 
 /*
- * caller must hold freezer->lock
- */
-static void update_freezer_state(struct cgroup *cgroup,
-				 struct freezer *freezer)
-{
-	struct cgroup_iter it;
-	struct task_struct *task;
-	unsigned int nfrozen = 0, ntotal = 0;
-
-	cgroup_iter_start(cgroup, &it);
-	while ((task = cgroup_iter_next(cgroup, &it))) {
-		ntotal++;
-		if (is_task_frozen_enough(task))
-			nfrozen++;
-	}
-
-	/*
-	 * Transition to FROZEN when no new tasks can be added ensures
-	 * that we never exist in the FROZEN state while there are unfrozen
-	 * tasks.
-	 */
-	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);
-}
-
-/*
  * cgroups_write_string() limits the size of freezer state strings to
  * CGROUP_LOCAL_BUFFER_SIZE
  */
@@ -485,7 +454,7 @@ static int freezer_checkpointing(struct task_struct *task,
 		/* May be in middle of a lazy FREEZING -> FROZEN transition */
 		if (cgroup_lock_live_group(css->cgroup)) {
 			spin_lock_irq(&freezer->lock);
-			update_freezer_state(css->cgroup, freezer);
+			update_if_frozen(css->cgroup, freezer);
 			spin_unlock_irq(&freezer->lock);
 			cgroup_unlock();
 		}
-- 
1.6.3.3

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list