diff options
author | Aleksa Sarai <cyphar@cyphar.com> | 2015-06-09 13:32:09 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-07-14 23:29:23 +0200 |
commit | 7e47682ea555e7c1edef1d8fd96e2aa4c12abe59 (patch) | |
tree | 6012cbc180ae7d633be4ed2ff1f1f6f7f188c1a0 /kernel/cgroup_freezer.c | |
parent | Linux 4.2-rc1 (diff) | |
download | linux-7e47682ea555e7c1edef1d8fd96e2aa4c12abe59.tar.xz linux-7e47682ea555e7c1edef1d8fd96e2aa4c12abe59.zip |
cgroup: allow a cgroup subsystem to reject a fork
Add a new cgroup subsystem callback can_fork that conditionally
states whether or not the fork is accepted or rejected by a cgroup
policy. In addition, add a cancel_fork callback so that if an error
occurs later in the forking process, any state modified by can_fork can
be reverted.
Allow for a private opaque pointer to be passed from cgroup_can_fork to
cgroup_post_fork, allowing for the fork state to be stored by each
subsystem separately.
Also add a tagging system for cgroup_subsys.h to allow for CGROUP_<TAG>
enumerations to be be defined and used. In addition, explicitly add a
CGROUP_CANFORK_COUNT macro to make arrays easier to define.
This is in preparation for implementing the pids cgroup subsystem.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup_freezer.c')
-rw-r--r-- | kernel/cgroup_freezer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index 92b98cc0ee76..f1b30ad5dc6d 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c @@ -203,7 +203,7 @@ static void freezer_attach(struct cgroup_subsys_state *new_css, * to do anything as freezer_attach() will put @task into the appropriate * state. */ -static void freezer_fork(struct task_struct *task) +static void freezer_fork(struct task_struct *task, void *private) { struct freezer *freezer; |