commit | c26d34a5858f96a564c45048bf5f09319d2abad1 | [log] [tgz] |
---|---|---|
author | Paul E. McKenney <[email protected]> | Mon Feb 22 17:04:46 2010 -0800 |
committer | Ingo Molnar <[email protected]> | Thu Feb 25 09:41:00 2010 +0100 |
tree | 644941c0005b8ecda4f5af3fd9f9c385f911f146 | |
parent | 632ee200130899252508c478ad0e808222573fbc [diff] [blame] |
rcu: Add lockdep-enabled variants of rcu_dereference() Make rcu_dereference() check for being in an RCU read-side critical section, and create rcu_dereference_bh(), rcu_dereference_sched(), and srcu_dereference() to check for the other flavors of RCU. Also create rcu_dereference_raw() to avoid checking, and make rcu_dereference_check() use rcu_dereference_raw(). Acked-by: Eric Dumazet <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index adbe167..3084f80 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h
@@ -106,6 +106,14 @@ #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ /** + * srcu_dereference - fetch SRCU-protected pointer with checking + * + * Makes rcu_dereference_check() do the dirty work. + */ +#define srcu_dereference(p, sp) \ + rcu_dereference_check(p, srcu_read_lock_held(sp)) + +/** * srcu_read_lock - register a new reader for an SRCU-protected structure. * @sp: srcu_struct in which to register the new reader. *