aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2009-04-14 14:17:16 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-15 06:05:25 -0400
commit05725f7eb4b8acb147c5fc7b91397b1f6bcab00d (patch)
tree1f22c6bec3429f7ec9ebb8acd25672249e39b380 /include/linux/sched.h
parent72c6a9870f901045f2464c3dc6ee8914bfdc07aa (diff)
rculist: use list_entry_rcu in places where it's appropriate
Use previously introduced list_entry_rcu instead of an open-coded list_entry + rcu_dereference combination. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: dipankar@in.ibm.com LKML-Reference: <20090414181715.GA3634@psychotron.englab.brq.redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b4c38bc8049c..886df41e7452 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -77,6 +77,7 @@ struct sched_param {
77#include <linux/proportions.h> 77#include <linux/proportions.h>
78#include <linux/seccomp.h> 78#include <linux/seccomp.h>
79#include <linux/rcupdate.h> 79#include <linux/rcupdate.h>
80#include <linux/rculist.h>
80#include <linux/rtmutex.h> 81#include <linux/rtmutex.h>
81 82
82#include <linux/time.h> 83#include <linux/time.h>
@@ -2010,7 +2011,8 @@ static inline unsigned long wait_task_inactive(struct task_struct *p,
2010} 2011}
2011#endif 2012#endif
2012 2013
2013#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) 2014#define next_task(p) \
2015 list_entry_rcu((p)->tasks.next, struct task_struct, tasks)
2014 2016
2015#define for_each_process(p) \ 2017#define for_each_process(p) \
2016 for (p = &init_task ; (p = next_task(p)) != &init_task ; ) 2018 for (p = &init_task ; (p = next_task(p)) != &init_task ; )
@@ -2049,8 +2051,8 @@ int same_thread_group(struct task_struct *p1, struct task_struct *p2)
2049 2051
2050static inline struct task_struct *next_thread(const struct task_struct *p) 2052static inline struct task_struct *next_thread(const struct task_struct *p)
2051{ 2053{
2052 return list_entry(rcu_dereference(p->thread_group.next), 2054 return list_entry_rcu(p->thread_group.next,
2053 struct task_struct, thread_group); 2055 struct task_struct, thread_group);
2054} 2056}
2055 2057
2056static inline int thread_group_empty(struct task_struct *p) 2058static inline int thread_group_empty(struct task_struct *p)