diff options
author | Andrew Morton <akpm@osdl.org> | 2006-03-31 05:31:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-31 15:18:59 -0500 |
commit | 158d9ebd19280582da172626ad3edda1a626dace (patch) | |
tree | 5b821a6faf28d136b65ae30a56e7f731adc11c28 | |
parent | 390e2ff07712468ce6600a43aa91e897b056ce12 (diff) |
[PATCH] resurrect __put_task_struct
This just got nuked in mainline. Bring it back because Eric's patches use it.
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/sched.h | 1 | ||||
-rw-r--r-- | kernel/fork.c | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 78c40dd2e19a..95f248ba36c9 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -906,6 +906,7 @@ extern void free_task(struct task_struct *tsk); | |||
906 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) | 906 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) |
907 | 907 | ||
908 | extern void __put_task_struct_cb(struct rcu_head *rhp); | 908 | extern void __put_task_struct_cb(struct rcu_head *rhp); |
909 | extern void __put_task_struct(struct task_struct *t); | ||
909 | 910 | ||
910 | static inline void put_task_struct(struct task_struct *t) | 911 | static inline void put_task_struct(struct task_struct *t) |
911 | { | 912 | { |
diff --git a/kernel/fork.c b/kernel/fork.c index b3f7a1bb5e55..b1341205be27 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -108,10 +108,8 @@ void free_task(struct task_struct *tsk) | |||
108 | } | 108 | } |
109 | EXPORT_SYMBOL(free_task); | 109 | EXPORT_SYMBOL(free_task); |
110 | 110 | ||
111 | void __put_task_struct_cb(struct rcu_head *rhp) | 111 | void __put_task_struct(struct task_struct *tsk) |
112 | { | 112 | { |
113 | struct task_struct *tsk = container_of(rhp, struct task_struct, rcu); | ||
114 | |||
115 | WARN_ON(!(tsk->exit_state & (EXIT_DEAD | EXIT_ZOMBIE))); | 113 | WARN_ON(!(tsk->exit_state & (EXIT_DEAD | EXIT_ZOMBIE))); |
116 | WARN_ON(atomic_read(&tsk->usage)); | 114 | WARN_ON(atomic_read(&tsk->usage)); |
117 | WARN_ON(tsk == current); | 115 | WARN_ON(tsk == current); |
@@ -126,6 +124,12 @@ void __put_task_struct_cb(struct rcu_head *rhp) | |||
126 | free_task(tsk); | 124 | free_task(tsk); |
127 | } | 125 | } |
128 | 126 | ||
127 | void __put_task_struct_cb(struct rcu_head *rhp) | ||
128 | { | ||
129 | struct task_struct *tsk = container_of(rhp, struct task_struct, rcu); | ||
130 | __put_task_struct(tsk); | ||
131 | } | ||
132 | |||
129 | void __init fork_init(unsigned long mempages) | 133 | void __init fork_init(unsigned long mempages) |
130 | { | 134 | { |
131 | #ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR | 135 | #ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR |