aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup_freezer.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-11-19 11:13:38 -0500
committerTejun Heo <tj@kernel.org>2012-11-19 11:13:38 -0500
commitb1929db42f8a649d9a9e397119f628c27fd4021f (patch)
tree04c0fa6f056395f8d17b5cd918403547be3f1425 /kernel/cgroup_freezer.c
parent4b8b47eb0001a89f271d671d959b235faa8f03e2 (diff)
cgroup: allow ->post_create() to fail
There could be cases where controllers want to do initialization operations which may fail from ->post_create(). This patch makes ->post_create() return -errno to indicate failure and online_css() relay such failures. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Cc: Glauber Costa <glommer@parallels.com>
Diffstat (limited to 'kernel/cgroup_freezer.c')
-rw-r--r--kernel/cgroup_freezer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 670a4af7dc94..ee8bb671688c 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -112,7 +112,7 @@ static struct cgroup_subsys_state *freezer_create(struct cgroup *cgroup)
112 * parent's freezing state while holding both parent's and our 112 * parent's freezing state while holding both parent's and our
113 * freezer->lock. 113 * freezer->lock.
114 */ 114 */
115static void freezer_post_create(struct cgroup *cgroup) 115static int freezer_post_create(struct cgroup *cgroup)
116{ 116{
117 struct freezer *freezer = cgroup_freezer(cgroup); 117 struct freezer *freezer = cgroup_freezer(cgroup);
118 struct freezer *parent = parent_freezer(freezer); 118 struct freezer *parent = parent_freezer(freezer);
@@ -136,6 +136,8 @@ static void freezer_post_create(struct cgroup *cgroup)
136 spin_unlock(&freezer->lock); 136 spin_unlock(&freezer->lock);
137 if (parent) 137 if (parent)
138 spin_unlock_irq(&parent->lock); 138 spin_unlock_irq(&parent->lock);
139
140 return 0;
139} 141}
140 142
141/** 143/**