Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37862
b: refs/heads/master
c: 1a657f7
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 2, 2006
1 parent bddac13 commit f3cd809
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1c0d04c9e44f4a248335c33d2be7c7f7b06ff359
refs/heads/master: 1a657f78dcc8ea7c53eaa1f2a45ea2315738c15f
4 changes: 2 additions & 2 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/pid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions trunk/kernel/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f3cd809

Please sign in to comment.