Lines Matching defs:ns

59 		.ns		= &init_pid_ns,
80 .ns.count = REFCOUNT_INIT(2),
86 .ns.inum = PROC_PID_INIT_INO,
88 .ns.ops = &pidns_operations,
114 struct pid_namespace *ns;
119 ns = pid->numbers[pid->level].ns;
121 kmem_cache_free(ns->pid_cachep, pid);
122 put_pid_ns(ns);
142 struct pid_namespace *ns = upid->ns;
143 switch (--ns->pid_allocated) {
150 wake_up_process(ns->child_reaper);
154 WARN_ON(ns->child_reaper);
155 ns->pid_allocated = 0;
159 idr_remove(&ns->idr, upid->nr);
166 struct pid *alloc_pid(struct pid_namespace *ns, pid_t *set_tid,
182 * never be greater than the current ns->level + 1.
184 if (set_tid_size > ns->level + 1)
187 pid = kmem_cache_alloc(ns->pid_cachep, GFP_KERNEL);
191 tmp = ns;
192 pid->level = ns->level;
194 for (i = ns->level; i >= 0; i--) {
198 tid = set_tid[ns->level - i];
252 pid->numbers[i].ns = tmp;
266 get_pid_ns(ns);
275 upid = pid->numbers + ns->level;
277 if (!(ns->pid_allocated & PIDNS_ADDING))
283 idr_replace(&upid->ns->idr, pid, upid->nr);
284 upid->ns->pid_allocated++;
292 put_pid_ns(ns);
296 while (++i <= ns->level) {
298 idr_remove(&upid->ns->idr, upid->nr);
302 if (ns->pid_allocated == PIDNS_ADDING)
303 idr_set_cursor(&ns->idr, 0);
307 kmem_cache_free(ns->pid_cachep, pid);
311 void disable_pid_allocation(struct pid_namespace *ns)
314 ns->pid_allocated &= ~PIDNS_ADDING;
318 struct pid *find_pid_ns(int nr, struct pid_namespace *ns)
320 return idr_find(&ns->idr, nr);
426 struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns)
430 return pid_task(find_pid_ns(nr, ns), PIDTYPE_PID);
485 pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns)
490 if (pid && ns->level <= pid->level) {
491 upid = &pid->numbers[ns->level];
492 if (upid->ns == ns)
506 struct pid_namespace *ns)
511 if (!ns)
512 ns = task_active_pid_ns(current);
513 nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns);
531 struct pid *find_ge_pid(int nr, struct pid_namespace *ns)
533 return idr_get_next(&ns->idr, &nr);