lkml.org 
[lkml]   [2010]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC tip/core/rcu 28/30] rcu: rename __do_rcu_dereference_check() to rcu_lockdep_assert()
Date
The __do_rcu_dereference_check() functionality needs to be exported,
so make a real name for it. This allows RCU-lockdep assertions to
be used independent of rcu_dereference() and friends.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
include/linux/rcupdate.h | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 0ce0f05..508ebba 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -209,7 +209,11 @@ static inline int rcu_read_lock_sched_held(void)

extern int rcu_my_thread_group_empty(void);

-#define __do_rcu_dereference_check(c) \
+/**
+ * rcu_lockdep_assert - emit lockdep splat if specified condition not met
+ * @c: condition to check
+ */
+#define rcu_lockdep_assert(c) \
do { \
static bool __warned; \
if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \
@@ -220,7 +224,7 @@ extern int rcu_my_thread_group_empty(void);

#else /* #ifdef CONFIG_PROVE_RCU */

-#define __do_rcu_dereference_check(c) do { } while (0)
+#define rcu_lockdep_assert(c) do { } while (0)

#endif /* #else #ifdef CONFIG_PROVE_RCU */

@@ -241,14 +245,14 @@ extern int rcu_my_thread_group_empty(void);
#define __rcu_dereference_check(p, c, space) \
({ \
typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \
- __do_rcu_dereference_check(c); \
+ rcu_lockdep_assert(c); \
(void) (((typeof (*p) space *)p) == p); \
smp_read_barrier_depends(); \
((typeof(*p) __force __kernel *)(_________p1)); \
})
#define __rcu_dereference_protected(p, c, space) \
({ \
- __do_rcu_dereference_check(c); \
+ rcu_lockdep_assert(c); \
(void) (((typeof (*p) space *)p) == p); \
((typeof(*p) __force __kernel *)(p)); \
})
@@ -256,7 +260,7 @@ extern int rcu_my_thread_group_empty(void);
#define __rcu_dereference_index_check(p, c) \
({ \
typeof(p) _________p1 = ACCESS_ONCE(p); \
- __do_rcu_dereference_check(c); \
+ rcu_lockdep_assert(c); \
smp_read_barrier_depends(); \
(_________p1); \
})
--
1.7.0.6


\
 
 \ /
  Last update: 2010-07-14 22:15    [W:0.121 / U:0.060 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site