[2/3] batman-adv: add __rcu annotations for gw_node
Commit Message
Add __rcu annotations for rcu protected pointers in the gateway code
to allow sparse checking.
Signed-off-by: Linus Lüssing <linus.luessing@ascom.ch>
---
compat.h | 6 ++++++
types.h | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
@@ -270,4 +270,10 @@ int bat_seq_printf(struct seq_file *m, const char *f, ...);
#endif /* < KERNEL_VERSION(2, 6, 33) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
+
+#define __rcu
+
+#endif /* < KERNEL_VERSION(2, 6, 36) */
+
#endif /* _NET_BATMAN_ADV_COMPAT_H_ */
@@ -98,7 +98,7 @@ struct orig_node {
struct gw_node {
struct hlist_node list;
- struct orig_node *orig_node;
+ struct orig_node __rcu *orig_node; /* rcu protected pointer */
unsigned long deleted;
atomic_t refcount;
struct rcu_head rcu;
@@ -172,7 +172,7 @@ struct bat_priv {
struct delayed_work hna_work;
struct delayed_work orig_work;
struct delayed_work vis_work;
- struct gw_node *curr_gw;
+ struct gw_node __rcu *curr_gw; /* rcu protected pointer */
struct vis_info *my_vis_info;
};