diff options
author | Sven Eckelmann <sven@narfation.org> | 2016-01-17 05:01:26 -0500 |
---|---|---|
committer | Antonio Quartulli <a@unstable.cc> | 2016-02-23 00:51:01 -0500 |
commit | 5dafd8a6ccf4175ba29f80430915eae2c5558e1e (patch) | |
tree | 75993eec4b29f52334ad5131675507ea2791a038 /net/batman-adv | |
parent | 95c0db90c791ebb73de89f960d12806f1708b31e (diff) |
batman-adv: Rename batadv_tt_global_entry *_free_ref function to *_put
The batman-adv source code is the only place in the kernel which uses the
*_free_ref naming scheme for the *_put functions. Changing it to *_put
makes it more consistent and makes it easier to understand the connection
to the *_get functions.
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')
-rw-r--r-- | net/batman-adv/translation-table.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index de3e731542e3..7f65a8f17f52 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -247,12 +247,12 @@ static void batadv_tt_global_entry_release(struct kref *ref) | |||
247 | } | 247 | } |
248 | 248 | ||
249 | /** | 249 | /** |
250 | * batadv_tt_global_entry_free_ref - decrement the tt_global_entry refcounter | 250 | * batadv_tt_global_entry_put - decrement the tt_global_entry refcounter and |
251 | * and possibly release it | 251 | * possibly release it |
252 | * @tt_global_entry: tt_global_entry to be free'd | 252 | * @tt_global_entry: tt_global_entry to be free'd |
253 | */ | 253 | */ |
254 | static void | 254 | static void |
255 | batadv_tt_global_entry_free_ref(struct batadv_tt_global_entry *tt_global_entry) | 255 | batadv_tt_global_entry_put(struct batadv_tt_global_entry *tt_global_entry) |
256 | { | 256 | { |
257 | kref_put(&tt_global_entry->common.refcount, | 257 | kref_put(&tt_global_entry->common.refcount, |
258 | batadv_tt_global_entry_release); | 258 | batadv_tt_global_entry_release); |
@@ -278,7 +278,7 @@ int batadv_tt_global_hash_count(struct batadv_priv *bat_priv, | |||
278 | return 0; | 278 | return 0; |
279 | 279 | ||
280 | count = atomic_read(&tt_global_entry->orig_list_count); | 280 | count = atomic_read(&tt_global_entry->orig_list_count); |
281 | batadv_tt_global_entry_free_ref(tt_global_entry); | 281 | batadv_tt_global_entry_put(tt_global_entry); |
282 | 282 | ||
283 | return count; | 283 | return count; |
284 | } | 284 | } |
@@ -561,7 +561,7 @@ static void batadv_tt_global_free(struct batadv_priv *bat_priv, | |||
561 | 561 | ||
562 | batadv_hash_remove(bat_priv->tt.global_hash, batadv_compare_tt, | 562 | batadv_hash_remove(bat_priv->tt.global_hash, batadv_compare_tt, |
563 | batadv_choose_tt, &tt_global->common); | 563 | batadv_choose_tt, &tt_global->common); |
564 | batadv_tt_global_entry_free_ref(tt_global); | 564 | batadv_tt_global_entry_put(tt_global); |
565 | } | 565 | } |
566 | 566 | ||
567 | /** | 567 | /** |
@@ -756,7 +756,7 @@ out: | |||
756 | if (tt_local) | 756 | if (tt_local) |
757 | batadv_tt_local_entry_put(tt_local); | 757 | batadv_tt_local_entry_put(tt_local); |
758 | if (tt_global) | 758 | if (tt_global) |
759 | batadv_tt_global_entry_free_ref(tt_global); | 759 | batadv_tt_global_entry_put(tt_global); |
760 | return ret; | 760 | return ret; |
761 | } | 761 | } |
762 | 762 | ||
@@ -1467,7 +1467,7 @@ static bool batadv_tt_global_add(struct batadv_priv *bat_priv, | |||
1467 | 1467 | ||
1468 | if (unlikely(hash_added != 0)) { | 1468 | if (unlikely(hash_added != 0)) { |
1469 | /* remove the reference for the hash */ | 1469 | /* remove the reference for the hash */ |
1470 | batadv_tt_global_entry_free_ref(tt_global_entry); | 1470 | batadv_tt_global_entry_put(tt_global_entry); |
1471 | goto out_remove; | 1471 | goto out_remove; |
1472 | } | 1472 | } |
1473 | } else { | 1473 | } else { |
@@ -1553,7 +1553,7 @@ out_remove: | |||
1553 | 1553 | ||
1554 | out: | 1554 | out: |
1555 | if (tt_global_entry) | 1555 | if (tt_global_entry) |
1556 | batadv_tt_global_entry_free_ref(tt_global_entry); | 1556 | batadv_tt_global_entry_put(tt_global_entry); |
1557 | if (tt_local_entry) | 1557 | if (tt_local_entry) |
1558 | batadv_tt_local_entry_put(tt_local_entry); | 1558 | batadv_tt_local_entry_put(tt_local_entry); |
1559 | return ret; | 1559 | return ret; |
@@ -1909,7 +1909,7 @@ static void batadv_tt_global_del(struct batadv_priv *bat_priv, | |||
1909 | 1909 | ||
1910 | out: | 1910 | out: |
1911 | if (tt_global_entry) | 1911 | if (tt_global_entry) |
1912 | batadv_tt_global_entry_free_ref(tt_global_entry); | 1912 | batadv_tt_global_entry_put(tt_global_entry); |
1913 | if (local_entry) | 1913 | if (local_entry) |
1914 | batadv_tt_local_entry_put(local_entry); | 1914 | batadv_tt_local_entry_put(local_entry); |
1915 | } | 1915 | } |
@@ -1965,7 +1965,7 @@ void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, | |||
1965 | tt_global->common.addr, | 1965 | tt_global->common.addr, |
1966 | BATADV_PRINT_VID(vid), message); | 1966 | BATADV_PRINT_VID(vid), message); |
1967 | hlist_del_rcu(&tt_common_entry->hash_entry); | 1967 | hlist_del_rcu(&tt_common_entry->hash_entry); |
1968 | batadv_tt_global_entry_free_ref(tt_global); | 1968 | batadv_tt_global_entry_put(tt_global); |
1969 | } | 1969 | } |
1970 | } | 1970 | } |
1971 | spin_unlock_bh(list_lock); | 1971 | spin_unlock_bh(list_lock); |
@@ -2028,7 +2028,7 @@ static void batadv_tt_global_purge(struct batadv_priv *bat_priv) | |||
2028 | 2028 | ||
2029 | hlist_del_rcu(&tt_common->hash_entry); | 2029 | hlist_del_rcu(&tt_common->hash_entry); |
2030 | 2030 | ||
2031 | batadv_tt_global_entry_free_ref(tt_global); | 2031 | batadv_tt_global_entry_put(tt_global); |
2032 | } | 2032 | } |
2033 | spin_unlock_bh(list_lock); | 2033 | spin_unlock_bh(list_lock); |
2034 | } | 2034 | } |
@@ -2060,7 +2060,7 @@ static void batadv_tt_global_table_free(struct batadv_priv *bat_priv) | |||
2060 | tt_global = container_of(tt_common_entry, | 2060 | tt_global = container_of(tt_common_entry, |
2061 | struct batadv_tt_global_entry, | 2061 | struct batadv_tt_global_entry, |
2062 | common); | 2062 | common); |
2063 | batadv_tt_global_entry_free_ref(tt_global); | 2063 | batadv_tt_global_entry_put(tt_global); |
2064 | } | 2064 | } |
2065 | spin_unlock_bh(list_lock); | 2065 | spin_unlock_bh(list_lock); |
2066 | } | 2066 | } |
@@ -2141,7 +2141,7 @@ struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv, | |||
2141 | 2141 | ||
2142 | out: | 2142 | out: |
2143 | if (tt_global_entry) | 2143 | if (tt_global_entry) |
2144 | batadv_tt_global_entry_free_ref(tt_global_entry); | 2144 | batadv_tt_global_entry_put(tt_global_entry); |
2145 | if (tt_local_entry) | 2145 | if (tt_local_entry) |
2146 | batadv_tt_local_entry_put(tt_local_entry); | 2146 | batadv_tt_local_entry_put(tt_local_entry); |
2147 | 2147 | ||
@@ -3431,7 +3431,7 @@ bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, u8 *src, u8 *dst, | |||
3431 | out: | 3431 | out: |
3432 | batadv_softif_vlan_put(vlan); | 3432 | batadv_softif_vlan_put(vlan); |
3433 | if (tt_global_entry) | 3433 | if (tt_global_entry) |
3434 | batadv_tt_global_entry_free_ref(tt_global_entry); | 3434 | batadv_tt_global_entry_put(tt_global_entry); |
3435 | if (tt_local_entry) | 3435 | if (tt_local_entry) |
3436 | batadv_tt_local_entry_put(tt_local_entry); | 3436 | batadv_tt_local_entry_put(tt_local_entry); |
3437 | return ret; | 3437 | return ret; |
@@ -3543,7 +3543,7 @@ bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv, | |||
3543 | goto out; | 3543 | goto out; |
3544 | 3544 | ||
3545 | ret = tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM; | 3545 | ret = tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM; |
3546 | batadv_tt_global_entry_free_ref(tt_global_entry); | 3546 | batadv_tt_global_entry_put(tt_global_entry); |
3547 | out: | 3547 | out: |
3548 | return ret; | 3548 | return ret; |
3549 | } | 3549 | } |
@@ -3863,7 +3863,7 @@ bool batadv_tt_global_is_isolated(struct batadv_priv *bat_priv, | |||
3863 | 3863 | ||
3864 | ret = tt->common.flags & BATADV_TT_CLIENT_ISOLA; | 3864 | ret = tt->common.flags & BATADV_TT_CLIENT_ISOLA; |
3865 | 3865 | ||
3866 | batadv_tt_global_entry_free_ref(tt); | 3866 | batadv_tt_global_entry_put(tt); |
3867 | 3867 | ||
3868 | return ret; | 3868 | return ret; |
3869 | } | 3869 | } |