cgroup: Fix issues in allow_attach callback

- Return -EINVAL when cgroups support isn't enabled
- Add allow_attach callback in CPU cgroups

Change-Id: Id3360b4a39919524fc4b6fcbd44fa2050009f000
Signed-off-by: Rom Lemarchand <romlem@android.com>
This commit is contained in:
Rom Lemarchand
2015-05-26 17:00:44 -07:00
committed by John Stultz
parent dccfe9526b
commit 0d6687a82a
2 changed files with 2 additions and 1 deletions

View File

@@ -566,7 +566,7 @@ static inline int cgroup_init(void) { return 0; }
static inline int subsys_cgroup_allow_attach(struct cgroup_subsys_state *css,
struct cgroup_taskset *tset)
{
return 0;
return -EINVAL;
}
#endif /* !CONFIG_CGROUPS */

View File

@@ -8609,6 +8609,7 @@ struct cgroup_subsys cpu_cgrp_subsys = {
.fork = cpu_cgroup_fork,
.can_attach = cpu_cgroup_can_attach,
.attach = cpu_cgroup_attach,
.allow_attach = subsys_cgroup_allow_attach,
.legacy_cftypes = cpu_files,
.early_init = 1,
};