From 228ebcbe634a30aec35132ea4375721bcc41bec0 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 18 Oct 2007 23:40:16 -0700 Subject: 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 Cc: Sukadev Bhattiprolu Cc: Oleg Nesterov Cc: Paul Menage Cc: "Eric W. Biederman" Acked-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sched.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'include/linux/sched.h') diff --git a/include/linux/sched.h b/include/linux/sched.h index 1301c087537..f4d969e8561 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1523,9 +1523,8 @@ extern struct pid_namespace init_pid_ns; * type and namespace specified * find_task_by_pid_ns(): * finds a task by its pid in the specified namespace - * find_task_by_pid_type(): - * finds a task by its global id with the specified type, e.g. - * by global session id + * find_task_by_vpid(): + * finds a task by its virtual pid * find_task_by_pid(): * finds a task by its global pid * @@ -1535,12 +1534,10 @@ extern struct pid_namespace init_pid_ns; extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, struct pid_namespace *ns); -#define find_task_by_pid_ns(nr, ns) \ - find_task_by_pid_type_ns(PIDTYPE_PID, nr, ns) -#define find_task_by_pid_type(type, nr) \ - find_task_by_pid_type_ns(type, nr, &init_pid_ns) -#define find_task_by_pid(nr) \ - find_task_by_pid_type(PIDTYPE_PID, nr) +extern struct task_struct *find_task_by_pid(pid_t nr); +extern struct task_struct *find_task_by_vpid(pid_t nr); +extern struct task_struct *find_task_by_pid_ns(pid_t nr, + struct pid_namespace *ns); extern void __set_special_pids(pid_t session, pid_t pgrp); -- cgit v1.2.3