diff options
author | Paul Menage <menage@google.com> | 2007-10-19 02:39:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:36 -0400 |
commit | b4f48b6363c81ca743ef46943ef23fd72e60f679 (patch) | |
tree | 40437b78e2d7a7d9d71e7bd63bc96e1ad02daa94 /include/linux/cgroup.h | |
parent | 355e0c48b757b7fcc79ccb98fda8105ed37a1598 (diff) |
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 e95143c884b2..792ad74be170 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -25,6 +25,9 @@ extern int cgroup_init(void); | |||
25 | extern void cgroup_init_smp(void); | 25 | extern void cgroup_init_smp(void); |
26 | extern void cgroup_lock(void); | 26 | extern void cgroup_lock(void); |
27 | extern void cgroup_unlock(void); | 27 | extern void cgroup_unlock(void); |
28 | extern void cgroup_fork(struct task_struct *p); | ||
29 | extern void cgroup_fork_callbacks(struct task_struct *p); | ||
30 | extern void cgroup_exit(struct task_struct *p, int run_callbacks); | ||
28 | 31 | ||
29 | /* Per-subsystem/per-cgroup state maintained by the system. */ | 32 | /* Per-subsystem/per-cgroup state maintained by the system. */ |
30 | struct cgroup_subsys_state { | 33 | struct cgroup_subsys_state { |
@@ -223,6 +226,9 @@ int cgroup_path(const struct cgroup *cont, char *buf, int buflen); | |||
223 | static inline int cgroup_init_early(void) { return 0; } | 226 | static inline int cgroup_init_early(void) { return 0; } |
224 | static inline int cgroup_init(void) { return 0; } | 227 | static inline int cgroup_init(void) { return 0; } |
225 | static inline void cgroup_init_smp(void) {} | 228 | static inline void cgroup_init_smp(void) {} |
229 | static inline void cgroup_fork(struct task_struct *p) {} | ||
230 | static inline void cgroup_fork_callbacks(struct task_struct *p) {} | ||
231 | static inline void cgroup_exit(struct task_struct *p, int callbacks) {} | ||
226 | 232 | ||
227 | static inline void cgroup_lock(void) {} | 233 | static inline void cgroup_lock(void) {} |
228 | static inline void cgroup_unlock(void) {} | 234 | static inline void cgroup_unlock(void) {} |