aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-10-19 02:40:16 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 14:53:40 -0400
commit228ebcbe634a30aec35132ea4375721bcc41bec0 (patch)
treea875976fd5bde6e2f931aa235c34c88a2738493f /include/linux/sched.h
parentb488893a390edfe027bae7a46e9af8083e740668 (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 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1301c0875370..f4d969e85612 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1523,9 +1523,8 @@ extern struct pid_namespace init_pid_ns;
1523 * type and namespace specified 1523 * type and namespace specified
1524 * find_task_by_pid_ns(): 1524 * find_task_by_pid_ns():
1525 * finds a task by its pid in the specified namespace 1525 * finds a task by its pid in the specified namespace
1526 * find_task_by_pid_type(): 1526 * find_task_by_vpid():
1527 * finds a task by its global id with the specified type, e.g. 1527 * finds a task by its virtual pid
1528 * by global session id
1529 * find_task_by_pid(): 1528 * find_task_by_pid():
1530 * finds a task by its global pid 1529 * finds a task by its global pid
1531 * 1530 *
@@ -1535,12 +1534,10 @@ extern struct pid_namespace init_pid_ns;
1535extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, 1534extern struct task_struct *find_task_by_pid_type_ns(int type, int pid,
1536 struct pid_namespace *ns); 1535 struct pid_namespace *ns);
1537 1536
1538#define find_task_by_pid_ns(nr, ns) \ 1537extern struct task_struct *find_task_by_pid(pid_t nr);
1539 find_task_by_pid_type_ns(PIDTYPE_PID, nr, ns) 1538extern struct task_struct *find_task_by_vpid(pid_t nr);
1540#define find_task_by_pid_type(type, nr) \ 1539extern struct task_struct *find_task_by_pid_ns(pid_t nr,
1541 find_task_by_pid_type_ns(type, nr, &init_pid_ns) 1540 struct pid_namespace *ns);
1542#define find_task_by_pid(nr) \
1543 find_task_by_pid_type(PIDTYPE_PID, nr)
1544 1541
1545extern void __set_special_pids(pid_t session, pid_t pgrp); 1542extern void __set_special_pids(pid_t session, pid_t pgrp);
1546 1543