aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcupdate.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2011-10-07 12:22:03 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-12-11 13:31:32 -0500
commitd8ab29f8be918b34a1ccd174569a53f0eb04b0a5 (patch)
tree397799eee7eecc96c98f866db1536a19f863b513 /include/linux/rcupdate.h
parent00f49e5729af602deb559b0cf293a00b625e8636 (diff)
rcu: Remove one layer of abstraction from PROVE_RCU checking
Simplify things a bit by substituting the definitions of the single-line rcu_read_acquire(), rcu_read_release(), rcu_read_acquire_bh(), rcu_read_release_bh(), rcu_read_acquire_sched(), and rcu_read_release_sched() functions at their call points. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r--include/linux/rcupdate.h53
1 files changed, 8 insertions, 45 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index d201c155f70c..5dd6fd8b3203 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -250,41 +250,8 @@ static inline void rcu_lock_release(struct lockdep_map *map)
250} 250}
251 251
252extern struct lockdep_map rcu_lock_map; 252extern struct lockdep_map rcu_lock_map;
253
254static inline void rcu_read_acquire(void)
255{
256 rcu_lock_acquire(&rcu_lock_map);
257}
258
259static inline void rcu_read_release(void)
260{
261 rcu_lock_release(&rcu_lock_map);
262}
263
264extern struct lockdep_map rcu_bh_lock_map; 253extern struct lockdep_map rcu_bh_lock_map;
265
266static inline void rcu_read_acquire_bh(void)
267{
268 rcu_lock_acquire(&rcu_bh_lock_map);
269}
270
271static inline void rcu_read_release_bh(void)
272{
273 rcu_lock_release(&rcu_bh_lock_map);
274}
275
276extern struct lockdep_map rcu_sched_lock_map; 254extern struct lockdep_map rcu_sched_lock_map;
277
278static inline void rcu_read_acquire_sched(void)
279{
280 rcu_lock_acquire(&rcu_sched_lock_map);
281}
282
283static inline void rcu_read_release_sched(void)
284{
285 rcu_lock_release(&rcu_sched_lock_map);
286}
287
288extern int debug_lockdep_rcu_enabled(void); 255extern int debug_lockdep_rcu_enabled(void);
289 256
290/** 257/**
@@ -364,12 +331,8 @@ static inline int rcu_read_lock_sched_held(void)
364 331
365#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 332#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
366 333
367# define rcu_read_acquire() do { } while (0) 334# define rcu_lock_acquire(a) do { } while (0)
368# define rcu_read_release() do { } while (0) 335# define rcu_lock_release(a) do { } while (0)
369# define rcu_read_acquire_bh() do { } while (0)
370# define rcu_read_release_bh() do { } while (0)
371# define rcu_read_acquire_sched() do { } while (0)
372# define rcu_read_release_sched() do { } while (0)
373 336
374static inline int rcu_read_lock_held(void) 337static inline int rcu_read_lock_held(void)
375{ 338{
@@ -690,7 +653,7 @@ static inline void rcu_read_lock(void)
690{ 653{
691 __rcu_read_lock(); 654 __rcu_read_lock();
692 __acquire(RCU); 655 __acquire(RCU);
693 rcu_read_acquire(); 656 rcu_lock_acquire(&rcu_lock_map);
694} 657}
695 658
696/* 659/*
@@ -710,7 +673,7 @@ static inline void rcu_read_lock(void)
710 */ 673 */
711static inline void rcu_read_unlock(void) 674static inline void rcu_read_unlock(void)
712{ 675{
713 rcu_read_release(); 676 rcu_lock_release(&rcu_lock_map);
714 __release(RCU); 677 __release(RCU);
715 __rcu_read_unlock(); 678 __rcu_read_unlock();
716} 679}
@@ -731,7 +694,7 @@ static inline void rcu_read_lock_bh(void)
731{ 694{
732 local_bh_disable(); 695 local_bh_disable();
733 __acquire(RCU_BH); 696 __acquire(RCU_BH);
734 rcu_read_acquire_bh(); 697 rcu_lock_acquire(&rcu_bh_lock_map);
735} 698}
736 699
737/* 700/*
@@ -741,7 +704,7 @@ static inline void rcu_read_lock_bh(void)
741 */ 704 */
742static inline void rcu_read_unlock_bh(void) 705static inline void rcu_read_unlock_bh(void)
743{ 706{
744 rcu_read_release_bh(); 707 rcu_lock_release(&rcu_bh_lock_map);
745 __release(RCU_BH); 708 __release(RCU_BH);
746 local_bh_enable(); 709 local_bh_enable();
747} 710}
@@ -758,7 +721,7 @@ static inline void rcu_read_lock_sched(void)
758{ 721{
759 preempt_disable(); 722 preempt_disable();
760 __acquire(RCU_SCHED); 723 __acquire(RCU_SCHED);
761 rcu_read_acquire_sched(); 724 rcu_lock_acquire(&rcu_sched_lock_map);
762} 725}
763 726
764/* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ 727/* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */
@@ -775,7 +738,7 @@ static inline notrace void rcu_read_lock_sched_notrace(void)
775 */ 738 */
776static inline void rcu_read_unlock_sched(void) 739static inline void rcu_read_unlock_sched(void)
777{ 740{
778 rcu_read_release_sched(); 741 rcu_lock_release(&rcu_sched_lock_map);
779 __release(RCU_SCHED); 742 __release(RCU_SCHED);
780 preempt_enable(); 743 preempt_enable();
781} 744}