Skip to contentSkip to conversation

just rename call_rcu_bh instead of making it a macro

PATCH In review Steven Rostedt 2 participants 2 messages Sep 26, 2007 RCU

lore
Share & tools
lore

Steven Rostedt

author reviewer
#0 lore raw

PATCH 1/1 just rename call_rcu_bh instead of making it a macro

Seems that I found a box that has a config that passes call_rcu_bh as a function pointer (see net/sctp/sm_make_chunk.c), so declaring the call_rcu_bh has a macro function isn't good enough.

This patch makes it just another name of call_rcu for rcupreempt.

include/linux/rcupreempt.h +8 -3
Index: linux-2.6.23-rc8-rt1/include/linux/rcupreempt.h
===================================================================
@@ -42,9 +42,14 @@
 #include <linux/cpumask.h>
 #include <linux/seqlock.h>
 
-#define rcu_qsctr_inc(cpu)
-#define rcu_bh_qsctr_inc(cpu)
-#define call_rcu_bh(head, rcu) call_rcu(head, rcu)
+#define rcu_qsctr_inc(cpu)	do { } while (0)
+#define rcu_bh_qsctr_inc(cpu)	do { } while (0)
+/*
+ * Someone might want to pass call_rcu_bh as a function pointer.
+ * So this needs to just be a rename and not a macro function.
+ *  (no parentheses)
+ */
+#define call_rcu_bh		 call_rcu
 
 extern void __rcu_read_lock(void);
 extern void __rcu_read_unlock(void);
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Steven Rostedt

Seems that I found a box that has a config that passes call_rcu_bh as a function pointer (see net/sctp/sm_make_chunk.c), so declaring the call_rcu_bh has a macro function isn't good enough.

This patch makes it just another name of call_rcu for rcupreempt.

Looks good!

Quoted 26 lines

Index: linux-2.6.23-rc8-rt1/include/linux/rcupreempt.h
===================================================================

include/linux/rcupreempt.h +8 -3
@@ -42,9 +42,14 @@
 #include <linux/cpumask.h>
 #include <linux/seqlock.h>
 
-#define rcu_qsctr_inc(cpu)
-#define rcu_bh_qsctr_inc(cpu)
-#define call_rcu_bh(head, rcu) call_rcu(head, rcu)
+#define rcu_qsctr_inc(cpu)	do { } while (0)
+#define rcu_bh_qsctr_inc(cpu)	do { } while (0)
+/*
+ * Someone might want to pass call_rcu_bh as a function pointer.
+ * So this needs to just be a rename and not a macro function.
+ *  (no parentheses)
+ */
+#define call_rcu_bh		 call_rcu
 
 extern void __rcu_read_lock(void);
 extern void __rcu_read_unlock(void);