17 struct task_struct *task;
18 struct list_head task_list;
19 struct list_head hash_chain;
24 struct list_head pid_chain;
29 #define pid_task(elem, type) \
30 list_entry(elem, struct task_struct, pids[type].pid_chain)
33 * attach_pid() and link_pid() must be called with the tasklist_lock
36 extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, int nr));
38 extern void FASTCALL(link_pid(struct task_struct *task, struct pid_link *link, struct pid *pid));
41 * detach_pid() must be called with the tasklist_lock write-held.
43 extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type));
46 * look up a PID in the hash table. Must be called with the tasklist_lock
49 extern struct pid *FASTCALL(find_pid(enum pid_type, int));
51 extern int alloc_pidmap(void);
52 extern void FASTCALL(free_pidmap(int));
53 extern void switch_exec_pids(struct task_struct *leader, struct task_struct *thread);
55 #define for_each_task_pid(who, type, task, elem, pid) \
56 if ((pid = find_pid(type, who))) \
57 for (elem = pid->task_list.next, \
58 prefetch(elem->next), \
59 task = pid_task(elem, type); \
60 elem != &pid->task_list; \
61 elem = elem->next, prefetch(elem->next), \
62 task = pid_task(elem, type))
64 #endif /* _LINUX_PID_H */