[PATCH] [rcu] Add lock annotations torcu{,_bh}_torture_read_{lock,unlock}

From: Josh Triplett
Date: Wed Jul 26 2006 - 15:07:41 EST

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@xxxxxxxxxxxxxxx>
kernel/rcutorture.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 4d1c3d2..4f2c427 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -192,13 +192,13 @@ static struct rcu_torture_ops *cur_ops =
* Definitions for rcu torture testing.

-static int rcu_torture_read_lock(void)
+static int rcu_torture_read_lock(void) __acquires(RCU)
return 0;

-static void rcu_torture_read_unlock(int idx)
+static void rcu_torture_read_unlock(int idx) __releases(RCU)
@@ -250,13 +250,13 @@ static struct rcu_torture_ops rcu_ops =
* Definitions for rcu_bh torture testing.

-static int rcu_bh_torture_read_lock(void)
+static int rcu_bh_torture_read_lock(void) __acquires(RCU_BH)
return 0;

-static void rcu_bh_torture_read_unlock(int idx)
+static void rcu_bh_torture_read_unlock(int idx) __releases(RCU_BH)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/