aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 541f4828f5e7..29b7d4f87d20 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -684,6 +684,7 @@ static inline void prefetch_stack(struct task_struct *t) { }
684 684
685struct audit_context; /* See audit.c */ 685struct audit_context; /* See audit.c */
686struct mempolicy; 686struct mempolicy;
687struct pipe_inode_info;
687 688
688enum sleep_type { 689enum sleep_type {
689 SLEEP_NORMAL, 690 SLEEP_NORMAL,
@@ -882,6 +883,11 @@ struct task_struct {
882 883
883 atomic_t fs_excl; /* holding fs exclusive resources */ 884 atomic_t fs_excl; /* holding fs exclusive resources */
884 struct rcu_head rcu; 885 struct rcu_head rcu;
886
887 /*
888 * cache last used pipe for splice
889 */
890 struct pipe_inode_info *splice_pipe;
885}; 891};
886 892
887static inline pid_t process_group(struct task_struct *tsk) 893static inline pid_t process_group(struct task_struct *tsk)
@@ -905,7 +911,6 @@ static inline int pid_alive(struct task_struct *p)
905extern void free_task(struct task_struct *tsk); 911extern void free_task(struct task_struct *tsk);
906#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) 912#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
907 913
908extern void __put_task_struct_cb(struct rcu_head *rhp);
909extern void __put_task_struct(struct task_struct *t); 914extern void __put_task_struct(struct task_struct *t);
910 915
911static inline void put_task_struct(struct task_struct *t) 916static inline void put_task_struct(struct task_struct *t)
@@ -1187,8 +1192,7 @@ extern void wait_task_inactive(task_t * p);
1187#define remove_parent(p) list_del_init(&(p)->sibling) 1192#define remove_parent(p) list_del_init(&(p)->sibling)
1188#define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children) 1193#define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children)
1189 1194
1190#define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks) 1195#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks)
1191#define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks)
1192 1196
1193#define for_each_process(p) \ 1197#define for_each_process(p) \
1194 for (p = &init_task ; (p = next_task(p)) != &init_task ; ) 1198 for (p = &init_task ; (p = next_task(p)) != &init_task ; )
@@ -1203,9 +1207,10 @@ extern void wait_task_inactive(task_t * p);
1203#define while_each_thread(g, t) \ 1207#define while_each_thread(g, t) \
1204 while ((t = next_thread(t)) != g) 1208 while ((t = next_thread(t)) != g)
1205 1209
1206#define thread_group_leader(p) (p->pid == p->tgid) 1210/* de_thread depends on thread_group_leader not being a pid based check */
1211#define thread_group_leader(p) (p == p->group_leader)
1207 1212
1208static inline task_t *next_thread(task_t *p) 1213static inline task_t *next_thread(const task_t *p)
1209{ 1214{
1210 return list_entry(rcu_dereference(p->thread_group.next), 1215 return list_entry(rcu_dereference(p->thread_group.next),
1211 task_t, thread_group); 1216 task_t, thread_group);