From 697f41610863c9264a7ae26dac9a387c9dda8c84 Mon Sep 17 00:00:00 2001 From: Paul Menage Date: Thu, 18 Oct 2007 23:39:34 -0700 Subject: Task Control Groups: add cgroup_clone() interface Add support for cgroup_clone(), a way to create new cgroups intended to be used for systems such as namespace unsharing. A new subsystem callback, post_clone(), is added to allow subsystems to automatically configure cloned cgroups. Signed-off-by: Paul Menage Cc: Serge E. Hallyn Cc: "Eric W. Biederman" Cc: Dave Hansen Cc: Balbir Singh Cc: Paul Jackson Cc: Kirill Korotaev Cc: Herbert Poetzl Cc: Srivatsa Vaddagiri Cc: Cedric Le Goater Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/cgroup.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 792ad74..b21cf09 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -182,6 +182,7 @@ struct cgroup_subsys { void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); int (*populate)(struct cgroup_subsys *ss, struct cgroup *cont); + void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cont); void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); int subsys_id; int active; @@ -221,6 +222,8 @@ static inline struct cgroup* task_cgroup(struct task_struct *task, int cgroup_path(const struct cgroup *cont, char *buf, int buflen); +int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *ss); + #else /* !CONFIG_CGROUPS */ static inline int cgroup_init_early(void) { return 0; } -- cgit v1.1