Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5de4fa13 authored by Tejun Heo's avatar Tejun Heo
Browse files

cgroup: initialize cgrp_dfl_root_inhibit_ss_mask from !->dfl_files test



cgrp_dfl_root_inhibit_ss_mask determines which subsystems are not
supported on the default hierarchy and is currently initialized
statically and just includes the debug subsystem.  Now that there's
cgroup_subsys->dfl_files, we can easily tell which subsystems support
the default hierarchy or not.

Let's initialize cgrp_dfl_root_inhibit_ss_mask by testing whether
cgroup_subsys->dfl_files is NULL.  After all, subsystems with NULL
->dfl_files aren't useable on the default hierarchy anyway.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarLi Zefan <lizefan@huawei.com>
parent 05ebb6e6
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -156,11 +156,7 @@ static bool cgrp_dfl_root_visible;
static bool cgroup_legacy_files_on_dfl;
static bool cgroup_legacy_files_on_dfl;


/* some controllers are not supported in the default hierarchy */
/* some controllers are not supported in the default hierarchy */
static const unsigned int cgrp_dfl_root_inhibit_ss_mask = 0
static unsigned int cgrp_dfl_root_inhibit_ss_mask;
#ifdef CONFIG_CGROUP_DEBUG
	| (1 << debug_cgrp_id)
#endif
	;


/* The list of hierarchy roots */
/* The list of hierarchy roots */


@@ -4939,6 +4935,9 @@ int __init cgroup_init(void)
		if (cgroup_legacy_files_on_dfl && !ss->dfl_cftypes)
		if (cgroup_legacy_files_on_dfl && !ss->dfl_cftypes)
			ss->dfl_cftypes = ss->legacy_cftypes;
			ss->dfl_cftypes = ss->legacy_cftypes;


		if (!ss->dfl_cftypes)
			cgrp_dfl_root_inhibit_ss_mask |= 1 << ss->id;

		if (ss->dfl_cftypes == ss->legacy_cftypes) {
		if (ss->dfl_cftypes == ss->legacy_cftypes) {
			WARN_ON(cgroup_add_cftypes(ss, ss->dfl_cftypes));
			WARN_ON(cgroup_add_cftypes(ss, ss->dfl_cftypes));
		} else {
		} else {