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/sys.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/sys.c')
-rw-r--r-- | kernel/sys.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 23620d52cf37..2befc299129d 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -152,8 +152,7 @@ asmlinkage long sys_setpriority(int which, int who, int niceval) | |||
152 | switch (which) { | 152 | switch (which) { |
153 | case PRIO_PROCESS: | 153 | case PRIO_PROCESS: |
154 | if (who) | 154 | if (who) |
155 | p = find_task_by_pid_ns(who, | 155 | p = find_task_by_vpid(who); |
156 | current->nsproxy->pid_ns); | ||
157 | else | 156 | else |
158 | p = current; | 157 | p = current; |
159 | if (p) | 158 | if (p) |
@@ -210,8 +209,7 @@ asmlinkage long sys_getpriority(int which, int who) | |||
210 | switch (which) { | 209 | switch (which) { |
211 | case PRIO_PROCESS: | 210 | case PRIO_PROCESS: |
212 | if (who) | 211 | if (who) |
213 | p = find_task_by_pid_ns(who, | 212 | p = find_task_by_vpid(who); |
214 | current->nsproxy->pid_ns); | ||
215 | else | 213 | else |
216 | p = current; | 214 | p = current; |
217 | if (p) { | 215 | if (p) { |
@@ -1067,7 +1065,8 @@ asmlinkage long sys_setsid(void) | |||
1067 | * session id and so the check will always fail and make it so | 1065 | * session id and so the check will always fail and make it so |
1068 | * init cannot successfully call setsid. | 1066 | * init cannot successfully call setsid. |
1069 | */ | 1067 | */ |
1070 | if (session > 1 && find_task_by_pid_type(PIDTYPE_PGID, session)) | 1068 | if (session > 1 && find_task_by_pid_type_ns(PIDTYPE_PGID, |
1069 | session, &init_pid_ns)) | ||
1071 | goto out; | 1070 | goto out; |
1072 | 1071 | ||
1073 | group_leader->signal->leader = 1; | 1072 | group_leader->signal->leader = 1; |