Skip to contentSkip to conversation

Add Sparse annotations to QRCU lock functions and rcutorture wrappers

PATCH New Josh Triplett 1 participant 1 message Dec 1, 2006 Sleepable read-copy update (SRCU)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add Sparse annotations to QRCU lock functions and rcutorture wrappers

---
 include/linux/srcu.h |    4 ++--
 kernel/rcutorture.c  |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
include/linux/srcu.h +2 -2
index fcdb749..03a9010 100644
@@ -64,8 +64,8 @@ struct qrcu_struct {
 };
 
 int init_qrcu_struct(struct qrcu_struct *qp);
-int qrcu_read_lock(struct qrcu_struct *qp);
-void qrcu_read_unlock(struct qrcu_struct *qp, int idx);
+int qrcu_read_lock(struct qrcu_struct *qp) __acquires(qp);
+void qrcu_read_unlock(struct qrcu_struct *qp, int idx) __releases(qp);
 void synchronize_qrcu(struct qrcu_struct *qp);
 
 /**
kernel/rcutorture.c +2 -2
index ddafbbf..e1c5c4b 100644
@@ -482,12 +482,12 @@ static void qrcu_torture_cleanup(void)
 	cleanup_qrcu_struct(&qrcu_ctl);
 }
 
-static int qrcu_torture_read_lock(void)
+static int qrcu_torture_read_lock(void) __acquires(&qrcu_ctl)
 {
 	return qrcu_read_lock(&qrcu_ctl);
 }
 
-static void qrcu_torture_read_unlock(int idx)
+static void qrcu_torture_read_unlock(int idx) __releases(&qrcu_ctl)
 {
 	qrcu_read_unlock(&qrcu_ctl, idx);
 }
Signature · 1 line
1.4.4.1