aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutorture.c
diff options
context:
space:
mode:
authorJosh Triplett <josht@us.ibm.com>2006-09-29 04:59:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 12:18:08 -0400
commita49a4af759c0193d42aeaeefb4df7de8973dd713 (patch)
treee93b6621352db514da2fd4ae364a5054f99fc6ac /kernel/rcutorture.c
parent9c4dbee79d3f46608bec3ac80d392ce6415d2f90 (diff)
[PATCH] rcu: add lock annotations to rcu{,_bh}_torture_read_{lock,unlock}
rcu_torture_read_lock and rcu_bh_torture_read_lock acquire locks without releasing them, and the matching functions rcu_torture_read_unlock and rcu_bh_torture_read_unlock get called with the corresponding locks held and release them. Add lock annotations to these four functions so that sparse can check callers for lock pairing, and so that sparse will not complain about these functions since they intentionally use locks in this manner. Signed-off-by: Josh Triplett <josh@freedesktop.org> Acked-by: Paul McKenney <paulmck@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/rcutorture.c')
-rw-r--r--kernel/rcutorture.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 4d1c3d247127..4f2c4272d59c 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -192,13 +192,13 @@ static struct rcu_torture_ops *cur_ops = NULL;
192 * Definitions for rcu torture testing. 192 * Definitions for rcu torture testing.
193 */ 193 */
194 194
195static int rcu_torture_read_lock(void) 195static int rcu_torture_read_lock(void) __acquires(RCU)
196{ 196{
197 rcu_read_lock(); 197 rcu_read_lock();
198 return 0; 198 return 0;
199} 199}
200 200
201static void rcu_torture_read_unlock(int idx) 201static void rcu_torture_read_unlock(int idx) __releases(RCU)
202{ 202{
203 rcu_read_unlock(); 203 rcu_read_unlock();
204} 204}
@@ -250,13 +250,13 @@ static struct rcu_torture_ops rcu_ops = {
250 * Definitions for rcu_bh torture testing. 250 * Definitions for rcu_bh torture testing.
251 */ 251 */
252 252
253static int rcu_bh_torture_read_lock(void) 253static int rcu_bh_torture_read_lock(void) __acquires(RCU_BH)
254{ 254{
255 rcu_read_lock_bh(); 255 rcu_read_lock_bh();
256 return 0; 256 return 0;
257} 257}
258 258
259static void rcu_bh_torture_read_unlock(int idx) 259static void rcu_bh_torture_read_unlock(int idx) __releases(RCU_BH)
260{ 260{
261 rcu_read_unlock_bh(); 261 rcu_read_unlock_bh();
262} 262}