diff options
author | Oleg Nesterov <oleg@redhat.com> | 2009-07-09 21:48:23 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-07-16 19:10:42 -0400 |
commit | 5bb459bb45d1ad3c177485dcf0af01580aa31125 (patch) | |
tree | fd6d11d424d222b97f56d8b870bdecbacaab8a17 /lib/is_single_threaded.c | |
parent | d2e3ee9b29f5de5b01e611b04e6fb29760589b01 (diff) |
kernel: rename is_single_threaded(task) to current_is_single_threaded(void)
- is_single_threaded(task) is not safe unless task == current,
we can't use task->signal or task->mm.
- it doesn't make sense unless task == current, the task can
fork right after the check.
Rename it to current_is_single_threaded() and kill the argument.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'lib/is_single_threaded.c')
-rw-r--r-- | lib/is_single_threaded.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/is_single_threaded.c b/lib/is_single_threaded.c index 2762516e0a5e..434010980bdf 100644 --- a/lib/is_single_threaded.c +++ b/lib/is_single_threaded.c | |||
@@ -15,8 +15,9 @@ | |||
15 | /* | 15 | /* |
16 | * Returns true if the task does not share ->mm with another thread/process. | 16 | * Returns true if the task does not share ->mm with another thread/process. |
17 | */ | 17 | */ |
18 | bool is_single_threaded(struct task_struct *task) | 18 | bool current_is_single_threaded(void) |
19 | { | 19 | { |
20 | struct task_struct *task = current; | ||
20 | struct mm_struct *mm = task->mm; | 21 | struct mm_struct *mm = task->mm; |
21 | struct task_struct *p, *t; | 22 | struct task_struct *p, *t; |
22 | bool ret; | 23 | bool ret; |