From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Sven Eckelmann Date: Fri, 17 Apr 2015 18:34:20 +0200 Message-Id: <1429288461-26260-5-git-send-email-sven@narfation.org> In-Reply-To: <1429288461-26260-1-git-send-email-sven@narfation.org> References: <13114664.Eg4ODy7KEo@bentobox> <1429288461-26260-1-git-send-email-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH-next 5/6] Revert "batman-adv: fix var name to keep compatibility with old kernels" Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: b.a.t.m.a.n@lists.open-mesh.org The original patch b53915310227cc9b029ba0fa5aae44e50a461f80 should not be submitted to net-next. So just remove it and replace it with compat code. Signed-off-by: Sven Eckelmann --- This compat code must be removed again when applying https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2015-April/012963.html compat.c | 9 +++++++++ compat.h | 1 + soft-interface.c | 12 ++++++------ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/compat.c b/compat.c index 3dbf9d2..516d06c 100644 --- a/compat.c +++ b/compat.c @@ -42,6 +42,15 @@ void batadv_free_rcu_softif_vlan(struct rcu_head *rcu) kfree(vlan); } +void batadv_free_rcu_vlan(struct rcu_head *rcu) +{ + struct batadv_softif_vlan *vlan; + + vlan = container_of(rcu, struct batadv_softif_vlan, rcu); + + kfree(vlan); +} + void batadv_free_rcu_tt_global_entry(struct rcu_head *rcu) { struct batadv_tt_global_entry *global; diff --git a/compat.h b/compat.h index 0332296..e55c1d6 100644 --- a/compat.h +++ b/compat.h @@ -234,6 +234,7 @@ void batadv_free_rcu_backbone_gw(struct rcu_head *rcu); void batadv_free_rcu_dat_entry(struct rcu_head *rcu); void batadv_free_rcu_nc_path(struct rcu_head *rcu); void batadv_free_rcu_tvlv_handler(struct rcu_head *rcu); +void batadv_free_rcu_vlan(struct rcu_head *rcu); static inline void skb_reset_mac_len(struct sk_buff *skb) { diff --git a/soft-interface.c b/soft-interface.c index 8748987..70edc41 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -453,14 +453,14 @@ out: * possibly free it * @softif_vlan: the vlan object to release */ -void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *softif_vlan) +void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *vlan) { - if (atomic_dec_and_test(&softif_vlan->refcount)) { - spin_lock_bh(&softif_vlan->bat_priv->softif_vlan_list_lock); - hlist_del_rcu(&softif_vlan->list); - spin_unlock_bh(&softif_vlan->bat_priv->softif_vlan_list_lock); + if (atomic_dec_and_test(&vlan->refcount)) { + spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock); + hlist_del_rcu(&vlan->list); + spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock); - kfree_rcu(softif_vlan, rcu); + kfree_rcu(vlan, rcu); } } -- 2.1.4