提交 5fff2825 编写于 作者: S Sven Eckelmann 提交者: Antonio Quartulli

batman-adv: Rename batadv_nc_path *_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: NSven Eckelmann <sven@narfation.org>
Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: NAntonio Quartulli <a@unstable.cc>
上级 27ad7545
...@@ -247,11 +247,11 @@ static void batadv_nc_path_release(struct kref *ref) ...@@ -247,11 +247,11 @@ static void batadv_nc_path_release(struct kref *ref)
} }
/** /**
* batadv_nc_path_free_ref - decrement the nc_path refcounter and possibly * batadv_nc_path_put - decrement the nc_path refcounter and possibly
* release it * release it
* @nc_path: nc_path to be free'd * @nc_path: nc_path to be free'd
*/ */
static void batadv_nc_path_free_ref(struct batadv_nc_path *nc_path) static void batadv_nc_path_put(struct batadv_nc_path *nc_path)
{ {
kref_put(&nc_path->refcount, batadv_nc_path_release); kref_put(&nc_path->refcount, batadv_nc_path_release);
} }
...@@ -263,7 +263,7 @@ static void batadv_nc_path_free_ref(struct batadv_nc_path *nc_path) ...@@ -263,7 +263,7 @@ static void batadv_nc_path_free_ref(struct batadv_nc_path *nc_path)
static void batadv_nc_packet_free(struct batadv_nc_packet *nc_packet) static void batadv_nc_packet_free(struct batadv_nc_packet *nc_packet)
{ {
kfree_skb(nc_packet->skb); kfree_skb(nc_packet->skb);
batadv_nc_path_free_ref(nc_packet->nc_path); batadv_nc_path_put(nc_packet->nc_path);
kfree(nc_packet); kfree(nc_packet);
} }
...@@ -467,7 +467,7 @@ static void batadv_nc_purge_paths(struct batadv_priv *bat_priv, ...@@ -467,7 +467,7 @@ static void batadv_nc_purge_paths(struct batadv_priv *bat_priv,
"Remove nc_path %pM -> %pM\n", "Remove nc_path %pM -> %pM\n",
nc_path->prev_hop, nc_path->next_hop); nc_path->prev_hop, nc_path->next_hop);
hlist_del_rcu(&nc_path->hash_entry); hlist_del_rcu(&nc_path->hash_entry);
batadv_nc_path_free_ref(nc_path); batadv_nc_path_put(nc_path);
} }
spin_unlock_bh(lock); spin_unlock_bh(lock);
} }
...@@ -1555,7 +1555,7 @@ bool batadv_nc_skb_forward(struct sk_buff *skb, ...@@ -1555,7 +1555,7 @@ bool batadv_nc_skb_forward(struct sk_buff *skb,
return true; return true;
free_nc_path: free_nc_path:
batadv_nc_path_free_ref(nc_path); batadv_nc_path_put(nc_path);
out: out:
/* Packet is not consumed */ /* Packet is not consumed */
return false; return false;
...@@ -1617,7 +1617,7 @@ void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv, ...@@ -1617,7 +1617,7 @@ void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv,
free_skb: free_skb:
kfree_skb(skb); kfree_skb(skb);
free_nc_path: free_nc_path:
batadv_nc_path_free_ref(nc_path); batadv_nc_path_put(nc_path);
out: out:
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册