[PATCH] Extract and use wake_up_klogd()
[linux-drm-fsl-dcu.git] / include / linux / pid.h
index 7e39767b4c60c597c7ce3182d9b1a15ed00a4ae2..4dec047b1837f1d7e365d1127dbbc68e4937d201 100644 (file)
@@ -35,8 +35,9 @@ enum pid_type
  *
  * Holding a reference to struct pid solves both of these problems.
  * It is small so holding a reference does not consume a lot of
- * resources, and since a new struct pid is allocated when the numeric
- * pid value is reused we don't mistakenly refer to new processes.
+ * resources, and since a new struct pid is allocated when the numeric pid
+ * value is reused (when pids wrap around) we don't mistakenly refer to new
+ * processes.
  */
 
 struct pid
@@ -68,6 +69,8 @@ extern struct task_struct *FASTCALL(pid_task(struct pid *pid, enum pid_type));
 extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid,
                                                enum pid_type));
 
+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.
@@ -103,28 +106,28 @@ static inline pid_t pid_nr(struct pid *pid)
 }
 
 
-#define do_each_task_pid(who, type, task)                                      \
-       do {                                                                    \
-               struct hlist_node *pos___;                                      \
-               struct pid *pid___ = find_pid(who);                             \
-               if (pid___ != NULL)                                             \
-                       hlist_for_each_entry_rcu((task), pos___,                \
+#define do_each_task_pid(who, type, task)                              \
+       do {                                                            \
+               struct hlist_node *pos___;                              \
+               struct pid *pid___ = find_pid(who);                     \
+               if (pid___ != NULL)                                     \
+                       hlist_for_each_entry_rcu((task), pos___,        \
                                &pid___->tasks[type], pids[type].node) {
 
-#define while_each_task_pid(who, type, task)                                   \
-                       }                                                       \
+#define while_each_task_pid(who, type, task)                           \
+                       }                                               \
        } while (0)
 
 
-#define do_each_pid_task(pid, type, task)                                      \
-       do {                                                                    \
-               struct hlist_node *pos___;                                      \
-               if (pid != NULL)                                                \
-                       hlist_for_each_entry_rcu((task), pos___,                \
+#define do_each_pid_task(pid, type, task)                              \
+       do {                                                            \
+               struct hlist_node *pos___;                              \
+               if (pid != NULL)                                        \
+                       hlist_for_each_entry_rcu((task), pos___,        \
                                &pid->tasks[type], pids[type].node) {
 
-#define while_each_pid_task(pid, type, task)                                   \
-                       }                                                       \
+#define while_each_pid_task(pid, type, task)                           \
+                       }                                               \
        } while (0)
 
 #endif /* _LINUX_PID_H */