Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71427
b: refs/heads/master
c: 2894d65
h: refs/heads/master
i:
  71425: 6d7a813
  71423: a710eea
v: v3
  • Loading branch information
Sukadev Bhattiprolu authored and Linus Torvalds committed Oct 19, 2007
1 parent e92958f commit a137649
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 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: baf8f0f82dd79e374bf6fa9e996393df2bae3c21
refs/heads/master: 2894d650cd9715d00ca196c711265819ef6ebd2d
2 changes: 1 addition & 1 deletion trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ static int de_thread(struct task_struct *tsk)
* so it is safe to do it under read_lock.
*/
if (unlikely(tsk->group_leader == child_reaper(tsk)))
tsk->nsproxy->pid_ns->child_reaper = tsk;
task_active_pid_ns(tsk)->child_reaper = tsk;

zap_other_threads(tsk);
read_unlock(&tasklist_lock);
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/proc/proc_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ static int loadavg_read_proc(char *page, char **start, off_t off,
LOAD_INT(a), LOAD_FRAC(a),
LOAD_INT(b), LOAD_FRAC(b),
LOAD_INT(c), LOAD_FRAC(c),
nr_running(), nr_threads, current->nsproxy->pid_ns->last_pid);
nr_running(), nr_threads,
task_active_pid_ns(current)->last_pid);
return proc_calc_metrics(page, start, off, count, eof, len);
}

Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/pid_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ static inline void put_pid_ns(struct pid_namespace *ns)
kref_put(&ns->kref, free_pid_ns);
}

static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk)
{
return tsk->nsproxy->pid_ns;
}

static inline struct task_struct *child_reaper(struct task_struct *tsk)
{
return init_pid_ns.child_reaper;
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/nsproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static struct nsproxy *create_new_namespaces(unsigned long flags,
goto out_ipc;
}

new_nsp->pid_ns = copy_pid_ns(flags, tsk->nsproxy->pid_ns);
new_nsp->pid_ns = copy_pid_ns(flags, task_active_pid_ns(tsk));
if (IS_ERR(new_nsp->pid_ns)) {
err = PTR_ERR(new_nsp->pid_ns);
goto out_pid;
Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ struct pid *alloc_pid(void)
int nr = -1;
struct pid_namespace *ns;

ns = current->nsproxy->pid_ns;
ns = task_active_pid_ns(current);
pid = kmem_cache_alloc(ns->pid_cachep, GFP_KERNEL);
if (!pid)
goto out;
Expand Down Expand Up @@ -364,7 +364,7 @@ struct pid *find_ge_pid(int nr)
pid = find_pid(nr);
if (pid)
break;
nr = next_pidmap(current->nsproxy->pid_ns, nr);
nr = next_pidmap(task_active_pid_ns(current), nr);
} while (nr > 0);

return pid;
Expand Down

0 comments on commit a137649

Please sign in to comment.