Skip to contentSkip to conversation

srcu: add missing header file

PATCH In review Lai Jiangshan 2 participants 2 messages Apr 17, 2010 – Apr 18, 2010 Sleepable read-copy update (SRCU)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 srcu: add missing header file

When I was writing a module, I hit this compile error. include/linux/srcu.h:39: error: field 'mutex' has incomplete type include/linux/srcu.h:41: error: field 'dep_map' has incomplete type

mutex.h is missed in srcu.h, but srcu.h uses struct mutex, so this patch adds this missing header file.

__percpu is defined in compiler.h which is included in mutex.h already. But I also include percpu.h because it names "__percpu".

---

include/linux/srcu.h +3 -0
index 4d5ecb2..675a16f 100644
@@ -27,6 +27,9 @@
 #ifndef _LINUX_SRCU_H
 #define _LINUX_SRCU_H
 
+#include <linux/percpu.h>
+#include <linux/mutex.h>
+
 struct srcu_struct_array {
 	int c[2];
 };
#1 lore raw
Quoted 10 lines · Lai Jiangshan

When I was writing a module, I hit this compile error. include/linux/srcu.h:39: error: field 'mutex' has incomplete type include/linux/srcu.h:41: error: field 'dep_map' has incomplete type

mutex.h is missed in srcu.h, but srcu.h uses struct mutex, so this patch adds this missing header file.

__percpu is defined in compiler.h which is included in mutex.h already. But I also include percpu.h because it names "__percpu".

Good catch!!! Queued for 2.6.35.

Thanx, Paul

Quoted 17 lines

---

include/linux/srcu.h +3 -0
index 4d5ecb2..675a16f 100644
@@ -27,6 +27,9 @@
 #ifndef _LINUX_SRCU_H
 #define _LINUX_SRCU_H
 
+#include <linux/percpu.h>
+#include <linux/mutex.h>
+
 struct srcu_struct_array {
 	int c[2];
 };