[PATCH] mtd: fix broken name_to_dev_t() declaration
[linux-2.6/verdex.git] / include / linux / pid.h
blob5b9082cc600fdf4d72c86f2d383b0eadbd8feba0
1 #ifndef _LINUX_PID_H
2 #define _LINUX_PID_H
4 enum pid_type
6 PIDTYPE_PID,
7 PIDTYPE_PGID,
8 PIDTYPE_SID,
9 PIDTYPE_MAX
12 struct pid
14 /* Try to keep pid_chain in the same cacheline as nr for find_pid */
15 int nr;
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
26 * write-held.
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
34 * held.
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); \
44 do {
46 #define while_each_task_pid(who, type, task) \
47 } while (task = pid_task((task)->pids[type].pid_list.next,\
48 type), \
49 prefetch((task)->pids[type].pid_list.next), \
50 hlist_unhashed(&(task)->pids[type].pid_chain)); \
51 } \
53 #endif /* _LINUX_PID_H */