Skip to content

Commit a22509a

Browse files
committed
Merge tag 'cgroup-for-6.15-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fixes from Tejun Heo: - Fix compilation in CONFIG_LOCKDEP && !CONFIG_PROVE_RCU configurations - Allow "cpuset_v2_mode" mount option for "cpuset" filesystem type to make life easier for android * tag 'cgroup-for-6.15-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup/cpuset-v1: Add missing support for cpuset_v2_mode cgroup: Fix compilation issue due to cgroup_mutex not being exported
2 parents 9d7a057 + 1bf67c8 commit a22509a

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

kernel/cgroup/cgroup.c

+30-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
DEFINE_MUTEX(cgroup_mutex);
9191
DEFINE_SPINLOCK(css_set_lock);
9292

93-
#ifdef CONFIG_PROVE_RCU
93+
#if (defined CONFIG_PROVE_RCU || defined CONFIG_LOCKDEP)
9494
EXPORT_SYMBOL_GPL(cgroup_mutex);
9595
EXPORT_SYMBOL_GPL(css_set_lock);
9696
#endif
@@ -2353,9 +2353,37 @@ static struct file_system_type cgroup2_fs_type = {
23532353
};
23542354

23552355
#ifdef CONFIG_CPUSETS_V1
2356+
enum cpuset_param {
2357+
Opt_cpuset_v2_mode,
2358+
};
2359+
2360+
static const struct fs_parameter_spec cpuset_fs_parameters[] = {
2361+
fsparam_flag ("cpuset_v2_mode", Opt_cpuset_v2_mode),
2362+
{}
2363+
};
2364+
2365+
static int cpuset_parse_param(struct fs_context *fc, struct fs_parameter *param)
2366+
{
2367+
struct cgroup_fs_context *ctx = cgroup_fc2context(fc);
2368+
struct fs_parse_result result;
2369+
int opt;
2370+
2371+
opt = fs_parse(fc, cpuset_fs_parameters, param, &result);
2372+
if (opt < 0)
2373+
return opt;
2374+
2375+
switch (opt) {
2376+
case Opt_cpuset_v2_mode:
2377+
ctx->flags |= CGRP_ROOT_CPUSET_V2_MODE;
2378+
return 0;
2379+
}
2380+
return -EINVAL;
2381+
}
2382+
23562383
static const struct fs_context_operations cpuset_fs_context_ops = {
23572384
.get_tree = cgroup1_get_tree,
23582385
.free = cgroup_fs_context_free,
2386+
.parse_param = cpuset_parse_param,
23592387
};
23602388

23612389
/*
@@ -2392,6 +2420,7 @@ static int cpuset_init_fs_context(struct fs_context *fc)
23922420
static struct file_system_type cpuset_fs_type = {
23932421
.name = "cpuset",
23942422
.init_fs_context = cpuset_init_fs_context,
2423+
.parameters = cpuset_fs_parameters,
23952424
.fs_flags = FS_USERNS_MOUNT,
23962425
};
23972426
#endif

0 commit comments

Comments
 (0)