From a82d3d8740deb3397b21609a268c22ff8ddedb9f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 10 Jan 2008 12:52:04 -0800 Subject: [PATCH] --- yaml --- r: 75393 b: refs/heads/master c: 84427eaef1fb91704c7112bdb598c810003b99f3 h: refs/heads/master i: 75391: 6e6905c9a7286282d94143e03884a1ed805ee1e2 v: v3 --- [refs] | 2 +- trunk/fs/proc/array.c | 4 ++-- trunk/include/linux/sched.h | 13 ------------- trunk/kernel/timer.c | 2 +- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 6efe10b31874..ac3e8880d93f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 974a9f0b47da74e28f68b9c8645c3786aa5ace1a +refs/heads/master: 84427eaef1fb91704c7112bdb598c810003b99f3 diff --git a/trunk/fs/proc/array.c b/trunk/fs/proc/array.c index 65c62e1bfd6f..810eb8fd6500 100644 --- a/trunk/fs/proc/array.c +++ b/trunk/fs/proc/array.c @@ -169,7 +169,7 @@ static inline char *task_state(struct task_struct *p, char *buffer) ppid = pid_alive(p) ? task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0; tpid = pid_alive(p) && p->ptrace ? - task_ppid_nr_ns(rcu_dereference(p->parent), ns) : 0; + task_pid_nr_ns(rcu_dereference(p->parent), ns) : 0; buffer += sprintf(buffer, "State:\t%s\n" "Tgid:\t%d\n" @@ -426,6 +426,7 @@ static int do_task_stat(struct task_struct *task, char *buffer, int whole) cgtime = gtime = cputime_zero; rcu_read_lock(); + ppid = task_tgid_nr_ns(task->real_parent, ns); if (lock_task_sighand(task, &flags)) { struct signal_struct *sig = task->signal; @@ -465,7 +466,6 @@ static int do_task_stat(struct task_struct *task, char *buffer, int whole) sid = task_session_nr_ns(task, ns); pgid = task_pgrp_nr_ns(task, ns); - ppid = task_ppid_nr_ns(task, ns); unlock_task_sighand(task, &flags); } diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index ac3d496fbd20..cc14656f8682 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -1255,13 +1255,6 @@ struct pid_namespace; * * set_task_vxid() : assigns a virtual id to a task; * - * task_ppid_nr_ns() : the parent's id as seen from the namespace specified. - * the result depends on the namespace and whether the - * task in question is the namespace's init. e.g. for the - * namespace's init this will return 0 when called from - * the namespace of this init, or appropriate id otherwise. - * - * * see also pid_nr() etc in include/linux/pid.h */ @@ -1317,12 +1310,6 @@ static inline pid_t task_session_vnr(struct task_struct *tsk) } -static inline pid_t task_ppid_nr_ns(struct task_struct *tsk, - struct pid_namespace *ns) -{ - return pid_nr_ns(task_pid(rcu_dereference(tsk->real_parent)), ns); -} - /** * pid_alive - check that a task structure is not stale * @p: Task structure to be checked. diff --git a/trunk/kernel/timer.c b/trunk/kernel/timer.c index d4527dcef1af..26671f4db07f 100644 --- a/trunk/kernel/timer.c +++ b/trunk/kernel/timer.c @@ -978,7 +978,7 @@ asmlinkage long sys_getppid(void) int pid; rcu_read_lock(); - pid = task_ppid_nr_ns(current, current->nsproxy->pid_ns); + pid = task_tgid_nr_ns(current->real_parent, current->nsproxy->pid_ns); rcu_read_unlock(); return pid;