aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2014-08-08 11:44:03 -0400
committerTejun Heo <tj@kernel.org>2014-08-22 13:20:40 -0400
commitfa8137be6ba632041e725e4623258ba27a2cf9be (patch)
tree32e4be27a8840f6fbfc0f91f59d4e48ee4e91a51 /kernel
parent71b1fb5c4473a5b1e601d41b109bdfe001ec82e0 (diff)
cgroup: Display legacy cgroup files on default hierarchy
Kernel command line parameter cgroup__DEVEL__legacy_files_on_dfl forces legacy cgroup files to show up on default hierarhcy if susbsystem does not have any files defined for default hierarchy. But this seems to be working only if legacy files are defined in ss->legacy_cftypes. If one adds some cftypes later using cgroup_add_legacy_cftypes(), these files don't show up on default hierarchy. Update the function accordingly so that the dynamically added legacy files also show up in the default hierarchy if the target subsystem is also using the base legacy files for the default hierarchy. tj: Patch description and comment updates. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index c3d1802a9b30..50b94113f4f7 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -3271,8 +3271,17 @@ int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
3271{ 3271{
3272 struct cftype *cft; 3272 struct cftype *cft;
3273 3273
3274 for (cft = cfts; cft && cft->name[0] != '\0'; cft++) 3274 /*
3275 cft->flags |= __CFTYPE_NOT_ON_DFL; 3275 * If legacy_flies_on_dfl, we want to show the legacy files on the
3276 * dfl hierarchy but iff the target subsystem hasn't been updated
3277 * for the dfl hierarchy yet.
3278 */
3279 if (!cgroup_legacy_files_on_dfl ||
3280 ss->dfl_cftypes != ss->legacy_cftypes) {
3281 for (cft = cfts; cft && cft->name[0] != '\0'; cft++)
3282 cft->flags |= __CFTYPE_NOT_ON_DFL;
3283 }
3284
3276 return cgroup_add_cftypes(ss, cfts); 3285 return cgroup_add_cftypes(ss, cfts);
3277} 3286}
3278 3287