Lines Matching refs:type
166 enum pid_type type; in alloc_pid() local
266 for (type = 0; type < PIDTYPE_MAX; ++type) in alloc_pid()
267 INIT_HLIST_HEAD(&pid->tasks[type]); in alloc_pid()
329 static struct pid **task_pid_ptr(struct task_struct *task, enum pid_type type) in task_pid_ptr() argument
331 return (type == PIDTYPE_PID) ? in task_pid_ptr()
333 &task->signal->pids[type]; in task_pid_ptr()
339 void attach_pid(struct task_struct *task, enum pid_type type) in attach_pid() argument
345 pid = *task_pid_ptr(task, type); in attach_pid()
346 hlist_add_head_rcu(&task->pid_links[type], &pid->tasks[type]); in attach_pid()
350 enum pid_type type, struct pid *new) in __change_pid() argument
357 pid_ptr = task_pid_ptr(task, type); in __change_pid()
360 hlist_del_rcu(&task->pid_links[type]); in __change_pid()
367 WARN_ON(pids[type]); in __change_pid()
368 pids[type] = pid; in __change_pid()
371 void detach_pid(struct pid **pids, struct task_struct *task, enum pid_type type) in detach_pid() argument
373 __change_pid(pids, task, type, NULL); in detach_pid()
376 void change_pid(struct pid **pids, struct task_struct *task, enum pid_type type, in change_pid() argument
379 __change_pid(pids, task, type, pid); in change_pid()
380 attach_pid(task, type); in change_pid()
406 enum pid_type type) in transfer_pid() argument
408 WARN_ON_ONCE(type == PIDTYPE_PID); in transfer_pid()
410 hlist_replace_rcu(&old->pid_links[type], &new->pid_links[type]); in transfer_pid()
413 struct task_struct *pid_task(struct pid *pid, enum pid_type type) in pid_task() argument
418 first = rcu_dereference_check(hlist_first_rcu(&pid->tasks[type]), in pid_task()
421 result = hlist_entry(first, struct task_struct, pid_links[(type)]); in pid_task()
455 struct pid *get_task_pid(struct task_struct *task, enum pid_type type) in get_task_pid() argument
459 pid = get_pid(rcu_dereference(*task_pid_ptr(task, type))); in get_task_pid()
465 struct task_struct *get_pid_task(struct pid *pid, enum pid_type type) in get_pid_task() argument
469 result = pid_task(pid, type); in get_pid_task()
509 pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, in __task_pid_nr_ns() argument
517 nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns); in __task_pid_nr_ns()
574 enum pid_type type; in pidfd_get_task() local
578 type = PIDTYPE_PID; in pidfd_get_task()
579 pid = get_task_pid(current, type); in pidfd_get_task()
582 type = PIDTYPE_TGID; in pidfd_get_task()
583 pid = get_task_pid(current, type); in pidfd_get_task()
589 type = PIDTYPE_TGID; in pidfd_get_task()
593 task = get_pid_task(pid, type); in pidfd_get_task()