diff options
author | Tejun Heo <tj@kernel.org> | 2010-04-05 04:37:28 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-04-05 04:37:28 +0200 |
commit | 336f5899d287f06d8329e208fc14ce50f7ec9698 (patch) | |
tree | 9b762d450d5eb248a6ff8317badb7e223d93ed58 /kernel/cgroup_freezer.c | |
parent | staging/otus: include slab.h from usbdrv.h (diff) | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 (diff) | |
download | linux-336f5899d287f06d8329e208fc14ce50f7ec9698.tar.xz linux-336f5899d287f06d8329e208fc14ce50f7ec9698.zip |
Merge branch 'master' into export-slabh
Diffstat (limited to 'kernel/cgroup_freezer.c')
-rw-r--r-- | kernel/cgroup_freezer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index d2ccd2798d7a..da5e13975531 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c @@ -48,17 +48,20 @@ static inline struct freezer *task_freezer(struct task_struct *task) struct freezer, css); } -int cgroup_frozen(struct task_struct *task) +int cgroup_freezing_or_frozen(struct task_struct *task) { struct freezer *freezer; enum freezer_state state; task_lock(task); freezer = task_freezer(task); - state = freezer->state; + if (!freezer->css.cgroup->parent) + state = CGROUP_THAWED; /* root cgroup can't be frozen */ + else + state = freezer->state; task_unlock(task); - return state == CGROUP_FROZEN; + return (state == CGROUP_FREEZING) || (state == CGROUP_FROZEN); } /* |