aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorPaul Menage <menage@google.com>2007-10-19 02:39:33 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 14:53:36 -0400
commitb4f48b6363c81ca743ef46943ef23fd72e60f679 (patch)
tree40437b78e2d7a7d9d71e7bd63bc96e1ad02daa94 /include/linux/cgroup.h
parent355e0c48b757b7fcc79ccb98fda8105ed37a1598 (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.h6
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);
25extern void cgroup_init_smp(void); 25extern void cgroup_init_smp(void);
26extern void cgroup_lock(void); 26extern void cgroup_lock(void);
27extern void cgroup_unlock(void); 27extern void cgroup_unlock(void);
28extern void cgroup_fork(struct task_struct *p);
29extern void cgroup_fork_callbacks(struct task_struct *p);
30extern 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. */
30struct cgroup_subsys_state { 33struct cgroup_subsys_state {
@@ -223,6 +226,9 @@ int cgroup_path(const struct cgroup *cont, char *buf, int buflen);
223static inline int cgroup_init_early(void) { return 0; } 226static inline int cgroup_init_early(void) { return 0; }
224static inline int cgroup_init(void) { return 0; } 227static inline int cgroup_init(void) { return 0; }
225static inline void cgroup_init_smp(void) {} 228static inline void cgroup_init_smp(void) {}
229static inline void cgroup_fork(struct task_struct *p) {}
230static inline void cgroup_fork_callbacks(struct task_struct *p) {}
231static inline void cgroup_exit(struct task_struct *p, int callbacks) {}
226 232
227static inline void cgroup_lock(void) {} 233static inline void cgroup_lock(void) {}
228static inline void cgroup_unlock(void) {} 234static inline void cgroup_unlock(void) {}