attach_pid() with struct pid parameter
attach_pid() currently takes a pid_t and then uses find_pid() to find the corresponding struct pid. Sometimes we already have the struct pid. We can then skip find_pid() if attach_pid() were to take a struct pid parameter. Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com> Cc: Cedric Le Goater <clg@fr.ibm.com> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: Serge Hallyn <serue@us.ibm.com> Cc: <containers@lists.osdl.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
4ac24b3ba9
commit
e713d0dab2
@@ -302,12 +302,12 @@ void __set_special_pids(pid_t session, pid_t pgrp)
|
||||
if (process_session(curr) != session) {
|
||||
detach_pid(curr, PIDTYPE_SID);
|
||||
set_signal_session(curr->signal, session);
|
||||
attach_pid(curr, PIDTYPE_SID, session);
|
||||
attach_pid(curr, PIDTYPE_SID, find_pid(session));
|
||||
}
|
||||
if (process_group(curr) != pgrp) {
|
||||
detach_pid(curr, PIDTYPE_PGID);
|
||||
curr->signal->pgrp = pgrp;
|
||||
attach_pid(curr, PIDTYPE_PGID, pgrp);
|
||||
attach_pid(curr, PIDTYPE_PGID, find_pid(pgrp));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user