16 /* Try to keep pid_chain in the same cacheline as nr for find_pid */
18 struct hlist_node pid_chain;
19 /* list of pids with the same nr, only one of them is in the hash */
20 struct list_head pid_list;
23 #define pid_task(elem, type) \
24 list_entry(elem, struct task_struct, pids[type].pid_list)
27 * attach_pid() and detach_pid() must be called with the tasklist_lock
30 extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, int nr));
32 extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type));
35 * look up a PID in the hash table. Must be called with the tasklist_lock
38 extern struct pid *FASTCALL(find_pid(enum pid_type, int));
40 extern int alloc_pidmap(void);
41 extern void FASTCALL(free_pidmap(int));
42 extern void switch_exec_pids(struct task_struct *leader, struct task_struct *thread);
44 #define do_each_task_pid(who, type, task) \
45 if ((task = find_task_by_pid_type(type, who))) { \
46 prefetch((task)->pids[type].pid_list.next); \
49 #define while_each_task_pid(who, type, task) \
50 } while (task = pid_task((task)->pids[type].pid_list.next,\
52 prefetch((task)->pids[type].pid_list.next), \
53 hlist_unhashed(&(task)->pids[type].pid_chain)); \
56 #endif /* _LINUX_PID_H */