From: Sukadev Bhattiprolu <sukadev@us.ibm.com>
attach_pid() currently takes a pid_t parameter and uses find_pid() to find
the struct pid associated with the pid_t. With containers, we sometimes
already have the struct pid and could skip the find_pid() - if we have a
version of attach_pid() that takes a struct pid parameter.
This patch renames the attach_pid() to find_attach_pid(). My next patch
defines attach_pid() to take a struct pid.
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
---
fs/exec.c | 2 +-
include/linux/pid.h | 4 ++--
kernel/exit.c | 4 ++--
kernel/fork.c | 6 +++---
kernel/pid.c | 3 ++-
kernel/sys.c | 2 +-
6 files changed, 11 insertions(+), 10 deletions(-)
Index: lx26-20-rc2-mm1/fs/exec.c
===================================================================
--- lx26-20-rc2-mm1.orig/fs/exec.c 2007-01-10 14:16:17.000000000 -0800
+++ lx26-20-rc2-mm1/fs/exec.c 2007-01-10 21:42:43.000000000 -0800
@@ -701,7 +701,7 @@ static int de_thread(struct task_struct
*/
detach_pid(tsk, PIDTYPE_PID);
tsk->pid = leader->pid;
- attach_pid(tsk, PIDTYPE_PID, tsk->pid);
+ find_attach_pid(tsk, PIDTYPE_PID, tsk->pid);
transfer_pid(leader, tsk, PIDTYPE_PGID);
transfer_pid(leader, tsk, PIDTYPE_SID);
list_replace_rcu(&leader->tasks, &tsk->tasks);
Index: lx26-20-rc2-mm1/include/linux/pid.h
===================================================================
--- lx26-20-rc2-mm1.orig/include/linux/pid.h 2007-01-10 14:16:18.000000000 -0800
+++ lx26-20-rc2-mm1/include/linux/pid.h 2007-01-11 04:44:06.674046656 -0800
@@ -72,10 +72,10 @@ extern struct task_struct *FASTCALL(get_
extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type);
/*
- * attach_pid() and detach_pid() must...