aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pid.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pid.h')
-rw-r--r--include/linux/pid.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/pid.h b/include/linux/pid.h
index c5fee61bfb4f..0dc940f4be46 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -99,17 +99,29 @@ extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type));
99extern void FASTCALL(transfer_pid(struct task_struct *old, 99extern void FASTCALL(transfer_pid(struct task_struct *old,
100 struct task_struct *new, enum pid_type)); 100 struct task_struct *new, enum pid_type));
101 101
102struct pid_namespace;
103extern struct pid_namespace init_pid_ns;
104
102/* 105/*
103 * look up a PID in the hash table. Must be called with the tasklist_lock 106 * look up a PID in the hash table. Must be called with the tasklist_lock
104 * or rcu_read_lock() held. 107 * or rcu_read_lock() held.
108 *
109 * find_pid_ns() finds the pid in the namespace specified
110 * find_pid() find the pid by its global id, i.e. in the init namespace
111 * find_vpid() finr the pid by its virtual id, i.e. in the current namespace
112 *
113 * see also find_task_by_pid() set in include/linux/sched.h
105 */ 114 */
106extern struct pid *FASTCALL(find_pid(int nr)); 115extern struct pid *FASTCALL(find_pid_ns(int nr, struct pid_namespace *ns));
116
117#define find_vpid(pid) find_pid_ns(pid, current->nsproxy->pid_ns)
118#define find_pid(pid) find_pid_ns(pid, &init_pid_ns)
107 119
108/* 120/*
109 * Lookup a PID in the hash table, and return with it's count elevated. 121 * Lookup a PID in the hash table, and return with it's count elevated.
110 */ 122 */
111extern struct pid *find_get_pid(int nr); 123extern struct pid *find_get_pid(int nr);
112extern struct pid *find_ge_pid(int nr); 124extern struct pid *find_ge_pid(int nr, struct pid_namespace *);
113 125
114extern struct pid *alloc_pid(struct pid_namespace *ns); 126extern struct pid *alloc_pid(struct pid_namespace *ns);
115extern void FASTCALL(free_pid(struct pid *pid)); 127extern void FASTCALL(free_pid(struct pid *pid));