14 /* Try to keep pid_chain in the same cacheline as nr for find_pid */
16 struct hlist_node pid_chain
;
17 /* list of pids with the same nr, only one of them is in the hash */
18 struct list_head pid_list
;
21 #define pid_task(elem, type) \
22 list_entry(elem, struct task_struct, pids[type].pid_list)
25 * attach_pid() and detach_pid() must be called with the tasklist_lock
28 extern int FASTCALL(attach_pid(struct task_struct
*task
, enum pid_type type
, int nr
));
30 extern void FASTCALL(detach_pid(struct task_struct
*task
, enum pid_type
));
33 * look up a PID in the hash table. Must be called with the tasklist_lock
36 extern struct pid
*FASTCALL(find_pid(enum pid_type
, int));
38 extern int alloc_pidmap(void);
39 extern void FASTCALL(free_pidmap(int));
41 #define do_each_task_pid(who, type, task) \
42 if ((task = find_task_by_pid_type(type, who))) { \
43 prefetch((task)->pids[type].pid_list.next); \
46 #define while_each_task_pid(who, type, task) \
47 } while (task = pid_task((task)->pids[type].pid_list.next,\
49 prefetch((task)->pids[type].pid_list.next), \
50 hlist_unhashed(&(task)->pids[type].pid_chain)); \
53 #endif /* _LINUX_PID_H */