Skip to content

Commit

Permalink
[PATCH] use current->nsproxy->pid_ns
Browse files Browse the repository at this point in the history
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Cedric Le Goater authored and Linus Torvalds committed Dec 8, 2006
1 parent 9a575a9 commit 6cc1b22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fs/proc/proc_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ 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, init_pid_ns.last_pid);
nr_running(), nr_threads, current->nsproxy->pid_ns->last_pid);
return proc_calc_metrics(page, start, off, count, eof, len);
}

Expand Down
6 changes: 3 additions & 3 deletions kernel/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ fastcall void free_pid(struct pid *pid)
hlist_del_rcu(&pid->pid_chain);
spin_unlock_irqrestore(&pidmap_lock, flags);

free_pidmap(&init_pid_ns, pid->nr);
free_pidmap(current->nsproxy->pid_ns, pid->nr);
call_rcu(&pid->rcu, delayed_put_pid);
}

Expand All @@ -210,7 +210,7 @@ struct pid *alloc_pid(void)
if (!pid)
goto out;

nr = alloc_pidmap(&init_pid_ns);
nr = alloc_pidmap(current->nsproxy->pid_ns);
if (nr < 0)
goto out_free;

Expand Down Expand Up @@ -352,7 +352,7 @@ struct pid *find_ge_pid(int nr)
pid = find_pid(nr);
if (pid)
break;
nr = next_pidmap(&init_pid_ns, nr);
nr = next_pidmap(current->nsproxy->pid_ns, nr);
} while (nr > 0);

return pid;
Expand Down

0 comments on commit 6cc1b22

Please sign in to comment.