diff options
author | Sven Eckelmann <sven@narfation.org> | 2016-01-16 10:29:40 +0100 |
---|---|---|
committer | Antonio Quartulli <a@unstable.cc> | 2016-02-10 23:23:58 +0800 |
commit | 90f564dff43c9c62d68568c550c011825f14a899 (patch) | |
tree | 48620c60a32587764d88e21ab0ef6c3bb7f64cfd /net/batman-adv/types.h | |
parent | dded0692247c76f892adee3ba6878ff5f394e210 (diff) | |
download | op-kernel-dev-90f564dff43c9c62d68568c550c011825f14a899.zip op-kernel-dev-90f564dff43c9c62d68568c550c011825f14a899.tar.gz |
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 'net/batman-adv/types.h')
-rw-r--r-- | net/batman-adv/types.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index 8974bc0..ace7900 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; }; |