Commit 1ce3ad5d authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

[PATCH] detach_pid(): eliminate one find_pid() call

Now there is no point in calling costly find_pid(type) if
__detach_pid(type) returned non zero value.
Acked-By: default avatarKirill Korotaev <dev@sw.ru>
Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e45f4903
......@@ -191,15 +191,16 @@ static fastcall int __detach_pid(task_t *task, enum pid_type type)
void fastcall detach_pid(task_t *task, enum pid_type type)
{
int nr;
int tmp, nr;
nr = __detach_pid(task, type);
if (!nr)
return;
for (type = 0; type < PIDTYPE_MAX; ++type)
if (find_pid(type, nr))
for (tmp = PIDTYPE_MAX; --tmp >= 0; )
if (tmp != type && find_pid(tmp, nr))
return;
free_pidmap(nr);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment