mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
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>
This commit is contained in:
parent
b488893a39
commit
228ebcbe63
12 changed files with 41 additions and 38 deletions
|
@ -63,8 +63,7 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
|
|||
read_lock(&tasklist_lock);
|
||||
|
||||
if (pid && pid != task_pid_vnr(current)) {
|
||||
target = find_task_by_pid_ns(pid,
|
||||
current->nsproxy->pid_ns);
|
||||
target = find_task_by_vpid(pid);
|
||||
if (!target) {
|
||||
ret = -ESRCH;
|
||||
goto out;
|
||||
|
@ -198,8 +197,7 @@ asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
|
|||
read_lock(&tasklist_lock);
|
||||
|
||||
if (pid > 0 && pid != task_pid_vnr(current)) {
|
||||
target = find_task_by_pid_ns(pid,
|
||||
current->nsproxy->pid_ns);
|
||||
target = find_task_by_vpid(pid);
|
||||
if (!target) {
|
||||
ret = -ESRCH;
|
||||
goto out;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue