diff --git a/[refs] b/[refs] index c21d80e7702c..293bc35a2e9e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1c0d04c9e44f4a248335c33d2be7c7f7b06ff359 +refs/heads/master: 1a657f78dcc8ea7c53eaa1f2a45ea2315738c15f diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c index a317eb2c4442..82da55b5cffe 100644 --- a/trunk/fs/proc/base.c +++ b/trunk/fs/proc/base.c @@ -958,7 +958,7 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st /* * grab the reference to task. */ - ei->pid = get_pid(task_pid(task)); + ei->pid = get_task_pid(task, PIDTYPE_PID); if (!ei->pid) goto out_unlock; @@ -1677,7 +1677,7 @@ static struct dentry *proc_base_instantiate(struct inode *dir, /* * grab the reference to the task. */ - ei->pid = get_pid(task_pid(task)); + ei->pid = get_task_pid(task, PIDTYPE_PID); if (!ei->pid) goto out_iput; diff --git a/trunk/include/linux/pid.h b/trunk/include/linux/pid.h index 7e39767b4c60..17b9e04d3586 100644 --- a/trunk/include/linux/pid.h +++ b/trunk/include/linux/pid.h @@ -68,6 +68,8 @@ extern struct task_struct *FASTCALL(pid_task(struct pid *pid, enum pid_type)); extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid, enum pid_type)); +extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); + /* * attach_pid() and detach_pid() must be called with the tasklist_lock * write-held. diff --git a/trunk/kernel/pid.c b/trunk/kernel/pid.c index e4779bbb2058..b914392085f9 100644 --- a/trunk/kernel/pid.c +++ b/trunk/kernel/pid.c @@ -304,6 +304,15 @@ struct task_struct *find_task_by_pid_type(int type, int nr) EXPORT_SYMBOL(find_task_by_pid_type); +struct pid *get_task_pid(struct task_struct *task, enum pid_type type) +{ + struct pid *pid; + rcu_read_lock(); + pid = get_pid(task->pids[type].pid); + rcu_read_unlock(); + return pid; +} + struct task_struct *fastcall get_pid_task(struct pid *pid, enum pid_type type) { struct task_struct *result;