|
|
@@ -219,12 +219,12 @@ static void batadv_tt_local_entry_release(struct kref *ref)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * batadv_tt_local_entry_free_ref - decrement the tt_local_entry refcounter and
|
|
|
+ * batadv_tt_local_entry_put - decrement the tt_local_entry refcounter and
|
|
|
* possibly release it
|
|
|
* @tt_local_entry: tt_local_entry to be free'd
|
|
|
*/
|
|
|
static void
|
|
|
-batadv_tt_local_entry_free_ref(struct batadv_tt_local_entry *tt_local_entry)
|
|
|
+batadv_tt_local_entry_put(struct batadv_tt_local_entry *tt_local_entry)
|
|
|
{
|
|
|
kref_put(&tt_local_entry->common.refcount,
|
|
|
batadv_tt_local_entry_release);
|
|
|
@@ -247,12 +247,12 @@ static void batadv_tt_global_entry_release(struct kref *ref)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * batadv_tt_global_entry_free_ref - decrement the tt_global_entry refcounter
|
|
|
- * and possibly release it
|
|
|
+ * batadv_tt_global_entry_put - decrement the tt_global_entry refcounter and
|
|
|
+ * possibly release it
|
|
|
* @tt_global_entry: tt_global_entry to be free'd
|
|
|
*/
|
|
|
static void
|
|
|
-batadv_tt_global_entry_free_ref(struct batadv_tt_global_entry *tt_global_entry)
|
|
|
+batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry)
|
|
|
{
|
|
|
kref_put(&tt_global_entry->common.refcount,
|
|
|
batadv_tt_global_entry_release);
|
|
|
@@ -278,7 +278,7 @@ int batadv_tt_global_hash_count(struct batadv_priv *bat_priv,
|
|
|
return 0;
|
|
|
|
|
|
count = atomic_read(&tt_global_entry->orig_list_count);
|
|
|
- batadv_tt_global_entry_free_ref(tt_global_entry);
|
|
|
+ batadv_tt_global_entry_put(tt_global_entry);
|
|
|
|
|
|
return count;
|
|
|
}
|
|
|
@@ -301,7 +301,7 @@ static void batadv_tt_local_size_mod(struct batadv_priv *bat_priv,
|
|
|
|
|
|
atomic_add(v, &vlan->tt.num_entries);
|
|
|
|
|
|
- batadv_softif_vlan_free_ref(vlan);
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -348,12 +348,12 @@ static void batadv_tt_global_size_mod(struct batadv_orig_node *orig_node,
|
|
|
spin_lock_bh(&orig_node->vlan_list_lock);
|
|
|
if (!hlist_unhashed(&vlan->list)) {
|
|
|
hlist_del_init_rcu(&vlan->list);
|
|
|
- batadv_orig_node_vlan_free_ref(vlan);
|
|
|
+ batadv_orig_node_vlan_put(vlan);
|
|
|
}
|
|
|
spin_unlock_bh(&orig_node->vlan_list_lock);
|
|
|
}
|
|
|
|
|
|
- batadv_orig_node_vlan_free_ref(vlan);
|
|
|
+ batadv_orig_node_vlan_put(vlan);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -392,17 +392,17 @@ static void batadv_tt_orig_list_entry_release(struct kref *ref)
|
|
|
orig_entry = container_of(ref, struct batadv_tt_orig_list_entry,
|
|
|
refcount);
|
|
|
|
|
|
- batadv_orig_node_free_ref(orig_entry->orig_node);
|
|
|
+ batadv_orig_node_put(orig_entry->orig_node);
|
|
|
kfree_rcu(orig_entry, rcu);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * batadv_tt_orig_list_entry_free_ref - decrement the tt orig entry refcounter
|
|
|
- * and possibly release it
|
|
|
+ * batadv_tt_orig_list_entry_put - decrement the tt orig entry refcounter and
|
|
|
+ * possibly release it
|
|
|
* @orig_entry: tt orig entry to be free'd
|
|
|
*/
|
|
|
static void
|
|
|
-batadv_tt_orig_list_entry_free_ref(struct batadv_tt_orig_list_entry *orig_entry)
|
|
|
+batadv_tt_orig_list_entry_put(struct batadv_tt_orig_list_entry *orig_entry)
|
|
|
{
|
|
|
kref_put(&orig_entry->refcount, batadv_tt_orig_list_entry_release);
|
|
|
}
|
|
|
@@ -561,7 +561,7 @@ static void batadv_tt_global_free(struct batadv_priv *bat_priv,
|
|
|
|
|
|
batadv_hash_remove(bat_priv->tt.global_hash, batadv_compare_tt,
|
|
|
batadv_choose_tt, &tt_global->common);
|
|
|
- batadv_tt_global_entry_free_ref(tt_global);
|
|
|
+ batadv_tt_global_entry_put(tt_global);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -687,8 +687,8 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const u8 *addr,
|
|
|
|
|
|
if (unlikely(hash_added != 0)) {
|
|
|
/* remove the reference for the hash */
|
|
|
- batadv_tt_local_entry_free_ref(tt_local);
|
|
|
- batadv_softif_vlan_free_ref(vlan);
|
|
|
+ batadv_tt_local_entry_put(tt_local);
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
@@ -754,9 +754,9 @@ out:
|
|
|
if (in_dev)
|
|
|
dev_put(in_dev);
|
|
|
if (tt_local)
|
|
|
- batadv_tt_local_entry_free_ref(tt_local);
|
|
|
+ batadv_tt_local_entry_put(tt_local);
|
|
|
if (tt_global)
|
|
|
- batadv_tt_global_entry_free_ref(tt_global);
|
|
|
+ batadv_tt_global_entry_put(tt_global);
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
@@ -1054,13 +1054,13 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset)
|
|
|
no_purge ? 0 : last_seen_msecs,
|
|
|
vlan->tt.crc);
|
|
|
|
|
|
- batadv_softif_vlan_free_ref(vlan);
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
}
|
|
|
rcu_read_unlock();
|
|
|
}
|
|
|
out:
|
|
|
if (primary_if)
|
|
|
- batadv_hardif_free_ref(primary_if);
|
|
|
+ batadv_hardif_put(primary_if);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1137,19 +1137,19 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr,
|
|
|
goto out;
|
|
|
|
|
|
/* extra call to free the local tt entry */
|
|
|
- batadv_tt_local_entry_free_ref(tt_local_entry);
|
|
|
+ batadv_tt_local_entry_put(tt_local_entry);
|
|
|
|
|
|
/* decrease the reference held for this vlan */
|
|
|
vlan = batadv_softif_vlan_get(bat_priv, vid);
|
|
|
if (!vlan)
|
|
|
goto out;
|
|
|
|
|
|
- batadv_softif_vlan_free_ref(vlan);
|
|
|
- batadv_softif_vlan_free_ref(vlan);
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
|
|
|
out:
|
|
|
if (tt_local_entry)
|
|
|
- batadv_tt_local_entry_free_ref(tt_local_entry);
|
|
|
+ batadv_tt_local_entry_put(tt_local_entry);
|
|
|
|
|
|
return curr_flags;
|
|
|
}
|
|
|
@@ -1245,11 +1245,11 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv)
|
|
|
vlan = batadv_softif_vlan_get(bat_priv,
|
|
|
tt_common_entry->vid);
|
|
|
if (vlan) {
|
|
|
- batadv_softif_vlan_free_ref(vlan);
|
|
|
- batadv_softif_vlan_free_ref(vlan);
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
}
|
|
|
|
|
|
- batadv_tt_local_entry_free_ref(tt_local);
|
|
|
+ batadv_tt_local_entry_put(tt_local);
|
|
|
}
|
|
|
spin_unlock_bh(list_lock);
|
|
|
}
|
|
|
@@ -1345,7 +1345,7 @@ batadv_tt_global_entry_has_orig(const struct batadv_tt_global_entry *entry,
|
|
|
orig_entry = batadv_tt_global_orig_entry_find(entry, orig_node);
|
|
|
if (orig_entry) {
|
|
|
found = true;
|
|
|
- batadv_tt_orig_list_entry_free_ref(orig_entry);
|
|
|
+ batadv_tt_orig_list_entry_put(orig_entry);
|
|
|
}
|
|
|
|
|
|
return found;
|
|
|
@@ -1386,7 +1386,7 @@ batadv_tt_global_orig_entry_add(struct batadv_tt_global_entry *tt_global,
|
|
|
|
|
|
out:
|
|
|
if (orig_entry)
|
|
|
- batadv_tt_orig_list_entry_free_ref(orig_entry);
|
|
|
+ batadv_tt_orig_list_entry_put(orig_entry);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1467,7 +1467,7 @@ static bool batadv_tt_global_add(struct batadv_priv *bat_priv,
|
|
|
|
|
|
if (unlikely(hash_added != 0)) {
|
|
|
/* remove the reference for the hash */
|
|
|
- batadv_tt_global_entry_free_ref(tt_global_entry);
|
|
|
+ batadv_tt_global_entry_put(tt_global_entry);
|
|
|
goto out_remove;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -1553,9 +1553,9 @@ out_remove:
|
|
|
|
|
|
out:
|
|
|
if (tt_global_entry)
|
|
|
- batadv_tt_global_entry_free_ref(tt_global_entry);
|
|
|
+ batadv_tt_global_entry_put(tt_global_entry);
|
|
|
if (tt_local_entry)
|
|
|
- batadv_tt_local_entry_free_ref(tt_local_entry);
|
|
|
+ batadv_tt_local_entry_put(tt_local_entry);
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
@@ -1586,20 +1586,20 @@ batadv_transtable_best_orig(struct batadv_priv *bat_priv,
|
|
|
if (best_router &&
|
|
|
bao->bat_neigh_cmp(router, BATADV_IF_DEFAULT,
|
|
|
best_router, BATADV_IF_DEFAULT) <= 0) {
|
|
|
- batadv_neigh_node_free_ref(router);
|
|
|
+ batadv_neigh_node_put(router);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
/* release the refcount for the "old" best */
|
|
|
if (best_router)
|
|
|
- batadv_neigh_node_free_ref(best_router);
|
|
|
+ batadv_neigh_node_put(best_router);
|
|
|
|
|
|
best_entry = orig_entry;
|
|
|
best_router = router;
|
|
|
}
|
|
|
|
|
|
if (best_router)
|
|
|
- batadv_neigh_node_free_ref(best_router);
|
|
|
+ batadv_neigh_node_put(best_router);
|
|
|
|
|
|
return best_entry;
|
|
|
}
|
|
|
@@ -1652,7 +1652,7 @@ batadv_tt_global_print_entry(struct batadv_priv *bat_priv,
|
|
|
((flags & BATADV_TT_CLIENT_ISOLA) ? 'I' : '.'),
|
|
|
((flags & BATADV_TT_CLIENT_TEMP) ? 'T' : '.'));
|
|
|
|
|
|
- batadv_orig_node_vlan_free_ref(vlan);
|
|
|
+ batadv_orig_node_vlan_put(vlan);
|
|
|
}
|
|
|
|
|
|
print_list:
|
|
|
@@ -1684,7 +1684,7 @@ print_list:
|
|
|
((flags & BATADV_TT_CLIENT_ISOLA) ? 'I' : '.'),
|
|
|
((flags & BATADV_TT_CLIENT_TEMP) ? 'T' : '.'));
|
|
|
|
|
|
- batadv_orig_node_vlan_free_ref(vlan);
|
|
|
+ batadv_orig_node_vlan_put(vlan);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1725,7 +1725,7 @@ int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset)
|
|
|
}
|
|
|
out:
|
|
|
if (primary_if)
|
|
|
- batadv_hardif_free_ref(primary_if);
|
|
|
+ batadv_hardif_put(primary_if);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1753,7 +1753,7 @@ _batadv_tt_global_del_orig_entry(struct batadv_tt_global_entry *tt_global_entry,
|
|
|
* being part of a list
|
|
|
*/
|
|
|
hlist_del_rcu(&orig_entry->list);
|
|
|
- batadv_tt_orig_list_entry_free_ref(orig_entry);
|
|
|
+ batadv_tt_orig_list_entry_put(orig_entry);
|
|
|
}
|
|
|
|
|
|
/* deletes the orig list of a tt_global_entry */
|
|
|
@@ -1909,9 +1909,9 @@ static void batadv_tt_global_del(struct batadv_priv *bat_priv,
|
|
|
|
|
|
out:
|
|
|
if (tt_global_entry)
|
|
|
- batadv_tt_global_entry_free_ref(tt_global_entry);
|
|
|
+ batadv_tt_global_entry_put(tt_global_entry);
|
|
|
if (local_entry)
|
|
|
- batadv_tt_local_entry_free_ref(local_entry);
|
|
|
+ batadv_tt_local_entry_put(local_entry);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1965,7 +1965,7 @@ void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
|
|
|
tt_global->common.addr,
|
|
|
BATADV_PRINT_VID(vid), message);
|
|
|
hlist_del_rcu(&tt_common_entry->hash_entry);
|
|
|
- batadv_tt_global_entry_free_ref(tt_global);
|
|
|
+ batadv_tt_global_entry_put(tt_global);
|
|
|
}
|
|
|
}
|
|
|
spin_unlock_bh(list_lock);
|
|
|
@@ -2028,7 +2028,7 @@ static void batadv_tt_global_purge(struct batadv_priv *bat_priv)
|
|
|
|
|
|
hlist_del_rcu(&tt_common->hash_entry);
|
|
|
|
|
|
- batadv_tt_global_entry_free_ref(tt_global);
|
|
|
+ batadv_tt_global_entry_put(tt_global);
|
|
|
}
|
|
|
spin_unlock_bh(list_lock);
|
|
|
}
|
|
|
@@ -2060,7 +2060,7 @@ static void batadv_tt_global_table_free(struct batadv_priv *bat_priv)
|
|
|
tt_global = container_of(tt_common_entry,
|
|
|
struct batadv_tt_global_entry,
|
|
|
common);
|
|
|
- batadv_tt_global_entry_free_ref(tt_global);
|
|
|
+ batadv_tt_global_entry_put(tt_global);
|
|
|
}
|
|
|
spin_unlock_bh(list_lock);
|
|
|
}
|
|
|
@@ -2141,9 +2141,9 @@ struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv,
|
|
|
|
|
|
out:
|
|
|
if (tt_global_entry)
|
|
|
- batadv_tt_global_entry_free_ref(tt_global_entry);
|
|
|
+ batadv_tt_global_entry_put(tt_global_entry);
|
|
|
if (tt_local_entry)
|
|
|
- batadv_tt_local_entry_free_ref(tt_local_entry);
|
|
|
+ batadv_tt_local_entry_put(tt_local_entry);
|
|
|
|
|
|
return orig_node;
|
|
|
}
|
|
|
@@ -2503,7 +2503,7 @@ static bool batadv_tt_global_check_crc(struct batadv_orig_node *orig_node,
|
|
|
return false;
|
|
|
|
|
|
crc = vlan->tt.crc;
|
|
|
- batadv_orig_node_vlan_free_ref(vlan);
|
|
|
+ batadv_orig_node_vlan_put(vlan);
|
|
|
|
|
|
if (crc != ntohl(tt_vlan_tmp->crc))
|
|
|
return false;
|
|
|
@@ -2638,7 +2638,7 @@ static int batadv_send_tt_request(struct batadv_priv *bat_priv,
|
|
|
|
|
|
out:
|
|
|
if (primary_if)
|
|
|
- batadv_hardif_free_ref(primary_if);
|
|
|
+ batadv_hardif_put(primary_if);
|
|
|
if (ret && tt_req_node) {
|
|
|
spin_lock_bh(&bat_priv->tt.req_list_lock);
|
|
|
/* hlist_del_init() verifies tt_req_node still is in the list */
|
|
|
@@ -2776,9 +2776,9 @@ unlock:
|
|
|
|
|
|
out:
|
|
|
if (res_dst_orig_node)
|
|
|
- batadv_orig_node_free_ref(res_dst_orig_node);
|
|
|
+ batadv_orig_node_put(res_dst_orig_node);
|
|
|
if (req_dst_orig_node)
|
|
|
- batadv_orig_node_free_ref(req_dst_orig_node);
|
|
|
+ batadv_orig_node_put(req_dst_orig_node);
|
|
|
kfree(tvlv_tt_data);
|
|
|
return ret;
|
|
|
}
|
|
|
@@ -2893,9 +2893,9 @@ unlock:
|
|
|
out:
|
|
|
spin_unlock_bh(&bat_priv->tt.commit_lock);
|
|
|
if (orig_node)
|
|
|
- batadv_orig_node_free_ref(orig_node);
|
|
|
+ batadv_orig_node_put(orig_node);
|
|
|
if (primary_if)
|
|
|
- batadv_hardif_free_ref(primary_if);
|
|
|
+ batadv_hardif_put(primary_if);
|
|
|
kfree(tvlv_tt_data);
|
|
|
/* The packet was for this host, so it doesn't need to be re-routed */
|
|
|
return true;
|
|
|
@@ -2981,7 +2981,7 @@ static void batadv_tt_fill_gtable(struct batadv_priv *bat_priv,
|
|
|
|
|
|
out:
|
|
|
if (orig_node)
|
|
|
- batadv_orig_node_free_ref(orig_node);
|
|
|
+ batadv_orig_node_put(orig_node);
|
|
|
}
|
|
|
|
|
|
static void batadv_tt_update_changes(struct batadv_priv *bat_priv,
|
|
|
@@ -3023,7 +3023,7 @@ bool batadv_is_my_client(struct batadv_priv *bat_priv, const u8 *addr,
|
|
|
ret = true;
|
|
|
out:
|
|
|
if (tt_local_entry)
|
|
|
- batadv_tt_local_entry_free_ref(tt_local_entry);
|
|
|
+ batadv_tt_local_entry_put(tt_local_entry);
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
@@ -3087,7 +3087,7 @@ static void batadv_handle_tt_response(struct batadv_priv *bat_priv,
|
|
|
spin_unlock_bh(&bat_priv->tt.req_list_lock);
|
|
|
out:
|
|
|
if (orig_node)
|
|
|
- batadv_orig_node_free_ref(orig_node);
|
|
|
+ batadv_orig_node_put(orig_node);
|
|
|
}
|
|
|
|
|
|
static void batadv_tt_roam_list_free(struct batadv_priv *bat_priv)
|
|
|
@@ -3218,7 +3218,7 @@ static void batadv_send_roam_adv(struct batadv_priv *bat_priv, u8 *client,
|
|
|
|
|
|
out:
|
|
|
if (primary_if)
|
|
|
- batadv_hardif_free_ref(primary_if);
|
|
|
+ batadv_hardif_put(primary_if);
|
|
|
}
|
|
|
|
|
|
static void batadv_tt_purge(struct work_struct *work)
|
|
|
@@ -3342,11 +3342,11 @@ static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv)
|
|
|
/* decrease the reference held for this vlan */
|
|
|
vlan = batadv_softif_vlan_get(bat_priv, tt_common->vid);
|
|
|
if (vlan) {
|
|
|
- batadv_softif_vlan_free_ref(vlan);
|
|
|
- batadv_softif_vlan_free_ref(vlan);
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
}
|
|
|
|
|
|
- batadv_tt_local_entry_free_ref(tt_local);
|
|
|
+ batadv_tt_local_entry_put(tt_local);
|
|
|
}
|
|
|
spin_unlock_bh(list_lock);
|
|
|
}
|
|
|
@@ -3429,11 +3429,11 @@ bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, u8 *src, u8 *dst,
|
|
|
ret = true;
|
|
|
|
|
|
out:
|
|
|
- batadv_softif_vlan_free_ref(vlan);
|
|
|
+ batadv_softif_vlan_put(vlan);
|
|
|
if (tt_global_entry)
|
|
|
- batadv_tt_global_entry_free_ref(tt_global_entry);
|
|
|
+ batadv_tt_global_entry_put(tt_global_entry);
|
|
|
if (tt_local_entry)
|
|
|
- batadv_tt_local_entry_free_ref(tt_local_entry);
|
|
|
+ batadv_tt_local_entry_put(tt_local_entry);
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
@@ -3543,7 +3543,7 @@ bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv,
|
|
|
goto out;
|
|
|
|
|
|
ret = tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM;
|
|
|
- batadv_tt_global_entry_free_ref(tt_global_entry);
|
|
|
+ batadv_tt_global_entry_put(tt_global_entry);
|
|
|
out:
|
|
|
return ret;
|
|
|
}
|
|
|
@@ -3569,7 +3569,7 @@ bool batadv_tt_local_client_is_roaming(struct batadv_priv *bat_priv,
|
|
|
goto out;
|
|
|
|
|
|
ret = tt_local_entry->common.flags & BATADV_TT_CLIENT_ROAM;
|
|
|
- batadv_tt_local_entry_free_ref(tt_local_entry);
|
|
|
+ batadv_tt_local_entry_put(tt_local_entry);
|
|
|
out:
|
|
|
return ret;
|
|
|
}
|
|
|
@@ -3802,7 +3802,7 @@ static int batadv_roam_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv,
|
|
|
|
|
|
out:
|
|
|
if (orig_node)
|
|
|
- batadv_orig_node_free_ref(orig_node);
|
|
|
+ batadv_orig_node_put(orig_node);
|
|
|
return NET_RX_SUCCESS;
|
|
|
}
|
|
|
|
|
|
@@ -3863,7 +3863,7 @@ bool batadv_tt_global_is_isolated(struct batadv_priv *bat_priv,
|
|
|
|
|
|
ret = tt->common.flags & BATADV_TT_CLIENT_ISOLA;
|
|
|
|
|
|
- batadv_tt_global_entry_free_ref(tt);
|
|
|
+ batadv_tt_global_entry_put(tt);
|
|
|
|
|
|
return ret;
|
|
|
}
|