15 /* Try to keep pid_chain in the same cacheline as nr for find_pid */
17 struct hlist_node pid_chain;
18 /* list of pids with the same nr, only one of them is in the hash */
19 struct list_head pid_list;
22 #define pid_task(elem, type) \
23 list_entry(elem, struct task_struct, pids[type].pid_list)
26 * attach_pid() and detach_pid() must be called with the tasklist_lock
29 extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, int nr));
31 extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type));
34 * look up a PID in the hash table. Must be called with the tasklist_lock
37 extern struct pid *FASTCALL(find_pid(enum pid_type, int));
39 extern int alloc_pidmap(void);
40 extern void FASTCALL(free_pidmap(int));
42 #define do_each_task_pid(who, type, task) \
43 if ((task = find_task_by_pid_type(type, who))) { \
44 prefetch((task)->pids[type].pid_list.next); \
47 #define while_each_task_pid(who, type, task) \
48 } while (task = pid_task((task)->pids[type].pid_list.next,\
50 prefetch((task)->pids[type].pid_list.next), \
51 hlist_unhashed(&(task)->pids[type].pid_chain)); \
54 #endif /* _LINUX_PID_H */