diff options
author | Sven Eckelmann <sven@narfation.org> | 2016-01-17 05:01:21 -0500 |
---|---|---|
committer | Antonio Quartulli <a@unstable.cc> | 2016-02-23 00:49:10 -0500 |
commit | 9c3bf08189bd4c0675032f5d3ca9dcb42cbb3ec8 (patch) | |
tree | 00f7450ef0a5b628a924b6954d24230d48edd748 | |
parent | 4a13147cb5d2cb45984074c1becb164a6e9d465f (diff) |
batman-adv: Rename batadv_softif_vlan *_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>
-rw-r--r-- | net/batman-adv/main.c | 2 | ||||
-rw-r--r-- | net/batman-adv/soft-interface.c | 14 | ||||
-rw-r--r-- | net/batman-adv/soft-interface.h | 2 | ||||
-rw-r--r-- | net/batman-adv/sysfs.c | 4 | ||||
-rw-r--r-- | net/batman-adv/translation-table.c | 20 |
5 files changed, 21 insertions, 21 deletions
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index bf8a01b8f026..e3d7051747b0 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -1261,7 +1261,7 @@ bool batadv_vlan_ap_isola_get(struct batadv_priv *bat_priv, unsigned short vid) | |||
1261 | vlan = batadv_softif_vlan_get(bat_priv, vid); | 1261 | vlan = batadv_softif_vlan_get(bat_priv, vid); |
1262 | if (vlan) { | 1262 | if (vlan) { |
1263 | ap_isolation_enabled = atomic_read(&vlan->ap_isolation); | 1263 | ap_isolation_enabled = atomic_read(&vlan->ap_isolation); |
1264 | batadv_softif_vlan_free_ref(vlan); | 1264 | batadv_softif_vlan_put(vlan); |
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | return ap_isolation_enabled; | 1267 | return ap_isolation_enabled; |
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index ca8fa4e28d4f..0710379491bf 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
@@ -497,11 +497,11 @@ static void batadv_softif_vlan_release(struct kref *ref) | |||
497 | } | 497 | } |
498 | 498 | ||
499 | /** | 499 | /** |
500 | * batadv_softif_vlan_free_ref - decrease the vlan object refcounter and | 500 | * batadv_softif_vlan_put - decrease the vlan object refcounter and |
501 | * possibly release it | 501 | * possibly release it |
502 | * @vlan: the vlan object to release | 502 | * @vlan: the vlan object to release |
503 | */ | 503 | */ |
504 | void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *vlan) | 504 | void batadv_softif_vlan_put(struct batadv_softif_vlan *vlan) |
505 | { | 505 | { |
506 | if (!vlan) | 506 | if (!vlan) |
507 | return; | 507 | return; |
@@ -552,7 +552,7 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid) | |||
552 | 552 | ||
553 | vlan = batadv_softif_vlan_get(bat_priv, vid); | 553 | vlan = batadv_softif_vlan_get(bat_priv, vid); |
554 | if (vlan) { | 554 | if (vlan) { |
555 | batadv_softif_vlan_free_ref(vlan); | 555 | batadv_softif_vlan_put(vlan); |
556 | return -EEXIST; | 556 | return -EEXIST; |
557 | } | 557 | } |
558 | 558 | ||
@@ -601,7 +601,7 @@ static void batadv_softif_destroy_vlan(struct batadv_priv *bat_priv, | |||
601 | vlan->vid, "vlan interface destroyed", false); | 601 | vlan->vid, "vlan interface destroyed", false); |
602 | 602 | ||
603 | batadv_sysfs_del_vlan(bat_priv, vlan); | 603 | batadv_sysfs_del_vlan(bat_priv, vlan); |
604 | batadv_softif_vlan_free_ref(vlan); | 604 | batadv_softif_vlan_put(vlan); |
605 | } | 605 | } |
606 | 606 | ||
607 | /** | 607 | /** |
@@ -646,7 +646,7 @@ static int batadv_interface_add_vid(struct net_device *dev, __be16 proto, | |||
646 | if (!vlan->kobj) { | 646 | if (!vlan->kobj) { |
647 | ret = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); | 647 | ret = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); |
648 | if (ret) { | 648 | if (ret) { |
649 | batadv_softif_vlan_free_ref(vlan); | 649 | batadv_softif_vlan_put(vlan); |
650 | return ret; | 650 | return ret; |
651 | } | 651 | } |
652 | } | 652 | } |
@@ -693,7 +693,7 @@ static int batadv_interface_kill_vid(struct net_device *dev, __be16 proto, | |||
693 | batadv_softif_destroy_vlan(bat_priv, vlan); | 693 | batadv_softif_destroy_vlan(bat_priv, vlan); |
694 | 694 | ||
695 | /* finally free the vlan object */ | 695 | /* finally free the vlan object */ |
696 | batadv_softif_vlan_free_ref(vlan); | 696 | batadv_softif_vlan_put(vlan); |
697 | 697 | ||
698 | return 0; | 698 | return 0; |
699 | } | 699 | } |
@@ -749,7 +749,7 @@ static void batadv_softif_destroy_finish(struct work_struct *work) | |||
749 | vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); | 749 | vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); |
750 | if (vlan) { | 750 | if (vlan) { |
751 | batadv_softif_destroy_vlan(bat_priv, vlan); | 751 | batadv_softif_destroy_vlan(bat_priv, vlan); |
752 | batadv_softif_vlan_free_ref(vlan); | 752 | batadv_softif_vlan_put(vlan); |
753 | } | 753 | } |
754 | 754 | ||
755 | batadv_sysfs_del_meshif(soft_iface); | 755 | batadv_sysfs_del_meshif(soft_iface); |
diff --git a/net/batman-adv/soft-interface.h b/net/batman-adv/soft-interface.h index d17cfbacf809..9ae265703d23 100644 --- a/net/batman-adv/soft-interface.h +++ b/net/batman-adv/soft-interface.h | |||
@@ -34,7 +34,7 @@ void batadv_softif_destroy_sysfs(struct net_device *soft_iface); | |||
34 | int batadv_softif_is_valid(const struct net_device *net_dev); | 34 | int batadv_softif_is_valid(const struct net_device *net_dev); |
35 | extern struct rtnl_link_ops batadv_link_ops; | 35 | extern struct rtnl_link_ops batadv_link_ops; |
36 | int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid); | 36 | int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid); |
37 | void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *softif_vlan); | 37 | void batadv_softif_vlan_put(struct batadv_softif_vlan *softif_vlan); |
38 | struct batadv_softif_vlan *batadv_softif_vlan_get(struct batadv_priv *bat_priv, | 38 | struct batadv_softif_vlan *batadv_softif_vlan_get(struct batadv_priv *bat_priv, |
39 | unsigned short vid); | 39 | unsigned short vid); |
40 | 40 | ||
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c index 0db7591a000f..4d70d4413e40 100644 --- a/net/batman-adv/sysfs.c +++ b/net/batman-adv/sysfs.c | |||
@@ -216,7 +216,7 @@ ssize_t batadv_store_vlan_##_name(struct kobject *kobj, \ | |||
216 | attr, &vlan->_name, \ | 216 | attr, &vlan->_name, \ |
217 | bat_priv->soft_iface); \ | 217 | bat_priv->soft_iface); \ |
218 | \ | 218 | \ |
219 | batadv_softif_vlan_free_ref(vlan); \ | 219 | batadv_softif_vlan_put(vlan); \ |
220 | return res; \ | 220 | return res; \ |
221 | } | 221 | } |
222 | 222 | ||
@@ -231,7 +231,7 @@ ssize_t batadv_show_vlan_##_name(struct kobject *kobj, \ | |||
231 | atomic_read(&vlan->_name) == 0 ? \ | 231 | atomic_read(&vlan->_name) == 0 ? \ |
232 | "disabled" : "enabled"); \ | 232 | "disabled" : "enabled"); \ |
233 | \ | 233 | \ |
234 | batadv_softif_vlan_free_ref(vlan); \ | 234 | batadv_softif_vlan_put(vlan); \ |
235 | return res; \ | 235 | return res; \ |
236 | } | 236 | } |
237 | 237 | ||
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 132635aa7b11..b81f8ea3395d 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -301,7 +301,7 @@ static void batadv_tt_local_size_mod(struct batadv_priv *bat_priv, | |||
301 | 301 | ||
302 | atomic_add(v, &vlan->tt.num_entries); | 302 | atomic_add(v, &vlan->tt.num_entries); |
303 | 303 | ||
304 | batadv_softif_vlan_free_ref(vlan); | 304 | batadv_softif_vlan_put(vlan); |
305 | } | 305 | } |
306 | 306 | ||
307 | /** | 307 | /** |
@@ -688,7 +688,7 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const u8 *addr, | |||
688 | if (unlikely(hash_added != 0)) { | 688 | if (unlikely(hash_added != 0)) { |
689 | /* remove the reference for the hash */ | 689 | /* remove the reference for the hash */ |
690 | batadv_tt_local_entry_free_ref(tt_local); | 690 | batadv_tt_local_entry_free_ref(tt_local); |
691 | batadv_softif_vlan_free_ref(vlan); | 691 | batadv_softif_vlan_put(vlan); |
692 | goto out; | 692 | goto out; |
693 | } | 693 | } |
694 | 694 | ||
@@ -1054,7 +1054,7 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset) | |||
1054 | no_purge ? 0 : last_seen_msecs, | 1054 | no_purge ? 0 : last_seen_msecs, |
1055 | vlan->tt.crc); | 1055 | vlan->tt.crc); |
1056 | 1056 | ||
1057 | batadv_softif_vlan_free_ref(vlan); | 1057 | batadv_softif_vlan_put(vlan); |
1058 | } | 1058 | } |
1059 | rcu_read_unlock(); | 1059 | rcu_read_unlock(); |
1060 | } | 1060 | } |
@@ -1144,8 +1144,8 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr, | |||
1144 | if (!vlan) | 1144 | if (!vlan) |
1145 | goto out; | 1145 | goto out; |
1146 | 1146 | ||
1147 | batadv_softif_vlan_free_ref(vlan); | 1147 | batadv_softif_vlan_put(vlan); |
1148 | batadv_softif_vlan_free_ref(vlan); | 1148 | batadv_softif_vlan_put(vlan); |
1149 | 1149 | ||
1150 | out: | 1150 | out: |
1151 | if (tt_local_entry) | 1151 | if (tt_local_entry) |
@@ -1245,8 +1245,8 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv) | |||
1245 | vlan = batadv_softif_vlan_get(bat_priv, | 1245 | vlan = batadv_softif_vlan_get(bat_priv, |
1246 | tt_common_entry->vid); | 1246 | tt_common_entry->vid); |
1247 | if (vlan) { | 1247 | if (vlan) { |
1248 | batadv_softif_vlan_free_ref(vlan); | 1248 | batadv_softif_vlan_put(vlan); |
1249 | batadv_softif_vlan_free_ref(vlan); | 1249 | batadv_softif_vlan_put(vlan); |
1250 | } | 1250 | } |
1251 | 1251 | ||
1252 | batadv_tt_local_entry_free_ref(tt_local); | 1252 | batadv_tt_local_entry_free_ref(tt_local); |
@@ -3342,8 +3342,8 @@ static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv) | |||
3342 | /* decrease the reference held for this vlan */ | 3342 | /* decrease the reference held for this vlan */ |
3343 | vlan = batadv_softif_vlan_get(bat_priv, tt_common->vid); | 3343 | vlan = batadv_softif_vlan_get(bat_priv, tt_common->vid); |
3344 | if (vlan) { | 3344 | if (vlan) { |
3345 | batadv_softif_vlan_free_ref(vlan); | 3345 | batadv_softif_vlan_put(vlan); |
3346 | batadv_softif_vlan_free_ref(vlan); | 3346 | batadv_softif_vlan_put(vlan); |
3347 | } | 3347 | } |
3348 | 3348 | ||
3349 | batadv_tt_local_entry_free_ref(tt_local); | 3349 | batadv_tt_local_entry_free_ref(tt_local); |
@@ -3429,7 +3429,7 @@ bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, u8 *src, u8 *dst, | |||
3429 | ret = true; | 3429 | ret = true; |
3430 | 3430 | ||
3431 | out: | 3431 | out: |
3432 | batadv_softif_vlan_free_ref(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_free_ref(tt_global_entry); |
3435 | if (tt_local_entry) | 3435 | if (tt_local_entry) |