cgroup: take options parsing into ->parse_monolithic()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 17 Jan 2019 04:42:38 +0000 (23:42 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 28 Feb 2019 08:29:30 +0000 (03:29 -0500)
commitf5dfb5315d340abd71bec523be9b114d5ac410de
treeb2bbeb90606b63e904bc309bb7f18c29cfd7b1c9
parent7feeef58690a5ea8c5033d43e696ef41b28d82eb
cgroup: take options parsing into ->parse_monolithic()

Store the results in cgroup_fs_context.  There's a nasty twist caused
by the enabling/disabling subsystems - we can't do the checks sensitive
to that until cgroup_mutex gets grabbed.  Frankly, these checks are
complete bullshit (e.g. all,none combination is accepted if all subsystems
are disabled; so's cpusets,none and all,cpusets when cpusets is disabled,
etc.), but touching that would be a userland-visible behaviour change ;-/

So we do parsing in ->parse_monolithic() and have the consistency checks
done in check_cgroupfs_options(), with the latter called (on already parsed
options) from cgroup1_get_tree() and cgroup1_reconfigure().

Freeing the strdup'ed strings is done from fs_context destructor, which
somewhat simplifies the life for cgroup1_{get_tree,reconfigure}().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
kernel/cgroup/cgroup-internal.h
kernel/cgroup/cgroup-v1.c
kernel/cgroup/cgroup.c