diff options
author | Oleg Nesterov <oleg@redhat.com> | 2010-05-26 17:43:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:47 -0400 |
commit | 7e49827cc937a742ae02078b483e3eb78f791a2a (patch) | |
tree | 0f3e0a8483a41b2221c74b8286b2349af03dab04 /fs/proc/base.c | |
parent | 6e1be45aa6ba6a36c0312f65ecf311135c73001d (diff) |
proc: get_nr_threads() doesn't need ->siglock any longer
Now that task->signal can't go away get_nr_threads() doesn't need
->siglock to read signal->count.
Also, make it inline, move into sched.h, and convert 2 other proc users of
signal->count to use this (now trivial) helper.
Henceforth get_nr_threads() is the only valid user of signal->count, we
are ready to turn it into "int nr_threads" or, perhaps, kill it.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index c7f9f23449dc..c384e8b84dff 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -166,18 +166,6 @@ static int get_fs_path(struct task_struct *task, struct path *path, bool root) | |||
166 | return result; | 166 | return result; |
167 | } | 167 | } |
168 | 168 | ||
169 | static int get_nr_threads(struct task_struct *tsk) | ||
170 | { | ||
171 | unsigned long flags; | ||
172 | int count = 0; | ||
173 | |||
174 | if (lock_task_sighand(tsk, &flags)) { | ||
175 | count = atomic_read(&tsk->signal->count); | ||
176 | unlock_task_sighand(tsk, &flags); | ||
177 | } | ||
178 | return count; | ||
179 | } | ||
180 | |||
181 | static int proc_cwd_link(struct inode *inode, struct path *path) | 169 | static int proc_cwd_link(struct inode *inode, struct path *path) |
182 | { | 170 | { |
183 | struct task_struct *task = get_proc_task(inode); | 171 | struct task_struct *task = get_proc_task(inode); |