aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2016-01-16 10:29:40 +0100
committerAntonio Quartulli <a@unstable.cc>2016-02-10 23:23:58 +0800
commit90f564dff43c9c62d68568c550c011825f14a899 (patch)
tree48620c60a32587764d88e21ab0ef6c3bb7f64cfd /net/batman-adv/types.h
parentbatman-adv: Add lockdep assert for container_list_lock (diff)
downloadlinux-dev-90f564dff43c9c62d68568c550c011825f14a899.tar.xz
linux-dev-90f564dff43c9c62d68568c550c011825f14a899.zip
batman-adv: Convert batadv_hardif_neigh_node to kref
batman-adv uses a self-written reference implementation which is just based on atomic_t. This is less obvious when reading the code than kref and therefore increases the change that the reference counting will be missed. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
Diffstat (limited to '')
-rw-r--r--net/batman-adv/types.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 8974bc0dc15c..ace7900347d4 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -25,6 +25,7 @@
#include <linux/bitops.h>
#include <linux/compiler.h>
#include <linux/if_ether.h>
+#include <linux/kref.h>
#include <linux/netdevice.h>
#include <linux/sched.h> /* for linux/wait.h */
#include <linux/spinlock.h>
@@ -359,7 +360,7 @@ struct batadv_hardif_neigh_node {
u8 addr[ETH_ALEN];
struct batadv_hard_iface *if_incoming;
unsigned long last_seen;
- atomic_t refcount;
+ struct kref refcount;
struct rcu_head rcu;
};