diff options
author | Paul Menage <menage@google.com> | 2007-10-18 23:39:33 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 11:53:36 -0700 |
commit | b4f48b6363c81ca743ef46943ef23fd72e60f679 (patch) | |
tree | 40437b78e2d7a7d9d71e7bd63bc96e1ad02daa94 /include/linux/cgroup.h | |
parent | 355e0c48b757b7fcc79ccb98fda8105ed37a1598 (diff) | |
download | op-kernel-dev-b4f48b6363c81ca743ef46943ef23fd72e60f679.zip op-kernel-dev-b4f48b6363c81ca743ef46943ef23fd72e60f679.tar.gz |
Task Control Groups: add fork()/exit() hooks
This adds the necessary hooks to the fork() and exit() paths to ensure
that new children inherit their parent's cgroup assignments, and that
exiting processes release reference counts on their cgroups.
Signed-off-by: Paul Menage <menage@google.com>
Cc: Serge E. Hallyn <serue@us.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Paul Jackson <pj@sgi.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index e95143c..792ad74 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -25,6 +25,9 @@ extern int cgroup_init(void); extern void cgroup_init_smp(void); extern void cgroup_lock(void); extern void cgroup_unlock(void); +extern void cgroup_fork(struct task_struct *p); +extern void cgroup_fork_callbacks(struct task_struct *p); +extern void cgroup_exit(struct task_struct *p, int run_callbacks); /* Per-subsystem/per-cgroup state maintained by the system. */ struct cgroup_subsys_state { @@ -223,6 +226,9 @@ int cgroup_path(const struct cgroup *cont, char *buf, int buflen); static inline int cgroup_init_early(void) { return 0; } static inline int cgroup_init(void) { return 0; } static inline void cgroup_init_smp(void) {} +static inline void cgroup_fork(struct task_struct *p) {} +static inline void cgroup_fork_callbacks(struct task_struct *p) {} +static inline void cgroup_exit(struct task_struct *p, int callbacks) {} static inline void cgroup_lock(void) {} static inline void cgroup_unlock(void) {} |