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/pid.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/pid.c')
-rw-r--r-- | kernel/pid.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/pid.c b/kernel/pid.c index b3e6d7c41b97..73a60e265f52 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -369,6 +369,25 @@ struct task_struct *find_task_by_pid_type_ns(int type, int nr, | |||
369 | 369 | ||
370 | EXPORT_SYMBOL(find_task_by_pid_type_ns); | 370 | EXPORT_SYMBOL(find_task_by_pid_type_ns); |
371 | 371 | ||
372 | struct task_struct *find_task_by_pid(pid_t nr) | ||
373 | { | ||
374 | return find_task_by_pid_type_ns(PIDTYPE_PID, nr, &init_pid_ns); | ||
375 | } | ||
376 | EXPORT_SYMBOL(find_task_by_pid); | ||
377 | |||
378 | struct task_struct *find_task_by_vpid(pid_t vnr) | ||
379 | { | ||
380 | return find_task_by_pid_type_ns(PIDTYPE_PID, vnr, | ||
381 | current->nsproxy->pid_ns); | ||
382 | } | ||
383 | EXPORT_SYMBOL(find_task_by_vpid); | ||
384 | |||
385 | struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns) | ||
386 | { | ||
387 | return find_task_by_pid_type_ns(PIDTYPE_PID, nr, ns); | ||
388 | } | ||
389 | EXPORT_SYMBOL(find_task_by_pid_ns); | ||
390 | |||
372 | struct pid *get_task_pid(struct task_struct *task, enum pid_type type) | 391 | struct pid *get_task_pid(struct task_struct *task, enum pid_type type) |
373 | { | 392 | { |
374 | struct pid *pid; | 393 | struct pid *pid; |