]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/pid.h
regulator: Add WM8400 regulator support
[linux-2.6-omap-h63xx.git] / include / linux / pid.h
index c7980810eb09d96becad505f2f9349e9a9a56685..d7e98ff8021eb3bfc38e4c851b425c7eac5c097f 100644 (file)
@@ -48,7 +48,7 @@ enum pid_type
  */
 
 struct upid {
-       /* Try to keep pid_chain in the same cacheline as nr for find_pid */
+       /* Try to keep pid_chain in the same cacheline as nr for find_vpid */
        int nr;
        struct pid_namespace *ns;
        struct hlist_node pid_chain;
@@ -57,10 +57,10 @@ struct upid {
 struct pid
 {
        atomic_t count;
+       unsigned int level;
        /* lists of tasks that use this pid */
        struct hlist_head tasks[PIDTYPE_MAX];
        struct rcu_head rcu;
-       int level;
        struct upid numbers[1];
 };
 
@@ -89,9 +89,11 @@ extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type);
  * attach_pid() and detach_pid() must be called with the tasklist_lock
  * write-held.
  */
-extern int attach_pid(struct task_struct *task, enum pid_type type,
-                     struct pid *pid);
+extern void attach_pid(struct task_struct *task, enum pid_type type,
+                       struct pid *pid);
 extern void detach_pid(struct task_struct *task, enum pid_type);
+extern void change_pid(struct task_struct *task, enum pid_type,
+                       struct pid *pid);
 extern void transfer_pid(struct task_struct *old, struct task_struct *new,
                         enum pid_type);
 
@@ -103,14 +105,12 @@ extern struct pid_namespace init_pid_ns;
  * or rcu_read_lock() held.
  *
  * find_pid_ns() finds the pid in the namespace specified
- * find_pid() find the pid by its global id, i.e. in the init namespace
  * find_vpid() finr the pid by its virtual id, i.e. in the current namespace
  *
- * see also find_task_by_pid() set in include/linux/sched.h
+ * see also find_task_by_vpid() set in include/linux/sched.h
  */
 extern struct pid *find_pid_ns(int nr, struct pid_namespace *ns);
 extern struct pid *find_vpid(int nr);
-extern struct pid *find_pid(int nr);
 
 /*
  * Lookup a PID in the hash table, and return with it's count elevated.
@@ -161,4 +161,13 @@ pid_t pid_vnr(struct pid *pid);
                        }                                               \
        } while (0)
 
+#define do_each_pid_thread(pid, type, task)                            \
+       do_each_pid_task(pid, type, task) {                             \
+               struct task_struct *tg___ = task;                       \
+               do {
+
+#define while_each_pid_thread(pid, type, task)                         \
+               } while_each_thread(tg___, task);                       \
+               task = tg___;                                           \
+       } while_each_pid_task(pid, type, task)
 #endif /* _LINUX_PID_H */