diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-10-19 02:40:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:40 -0400 |
commit | 228ebcbe634a30aec35132ea4375721bcc41bec0 (patch) | |
tree | a875976fd5bde6e2f931aa235c34c88a2738493f /kernel/futex.c | |
parent | b488893a390edfe027bae7a46e9af8083e740668 (diff) |
Uninline find_task_by_xxx set of functions
The find_task_by_something is a set of macros are used to find task by pid
depending on what kind of pid is proposed - global or virtual one. All of
them are wrappers above the most generic one - find_task_by_pid_type_ns() -
and just substitute some args for it.
It turned out, that dereferencing the current->nsproxy->pid_ns construction
and pushing one more argument on the stack inline cause kernel text size to
grow.
This patch moves all this stuff out-of-line into kernel/pid.c. Together
with the next patch it saves a bit less than 400 bytes from the .text
section.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Paul Menage <menage@google.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 86b2600381b6..32710451dc20 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -446,9 +446,7 @@ static struct task_struct * futex_find_get_task(pid_t pid) | |||
446 | struct task_struct *p; | 446 | struct task_struct *p; |
447 | 447 | ||
448 | rcu_read_lock(); | 448 | rcu_read_lock(); |
449 | p = find_task_by_pid_ns(pid, | 449 | p = find_task_by_vpid(pid); |
450 | current->nsproxy->pid_ns); | ||
451 | |||
452 | if (!p || ((current->euid != p->euid) && (current->euid != p->uid))) | 450 | if (!p || ((current->euid != p->euid) && (current->euid != p->uid))) |
453 | p = ERR_PTR(-ESRCH); | 451 | p = ERR_PTR(-ESRCH); |
454 | else | 452 | else |
@@ -1858,8 +1856,7 @@ sys_get_robust_list(int pid, struct robust_list_head __user * __user *head_ptr, | |||
1858 | 1856 | ||
1859 | ret = -ESRCH; | 1857 | ret = -ESRCH; |
1860 | rcu_read_lock(); | 1858 | rcu_read_lock(); |
1861 | p = find_task_by_pid_ns(pid, | 1859 | p = find_task_by_vpid(pid); |
1862 | current->nsproxy->pid_ns); | ||
1863 | if (!p) | 1860 | if (!p) |
1864 | goto err_unlock; | 1861 | goto err_unlock; |
1865 | ret = -EPERM; | 1862 | ret = -EPERM; |