net,rcu: convert call_rcu(netlbl_unlhsh_free_addr6) to kfree_rcu()
Subsystems (3)
PATCH 21/36 net,rcu: convert call_rcu(netlbl_unlhsh_free_addr6) to kfree_rcu()
The rcu callback netlbl_unlhsh_free_addr6() just calls a kfree(), so we use kfree_rcu() instead of the call_rcu(netlbl_unlhsh_free_addr6).
--- net/netlabel/netlabel_unlabeled.c | 22 +--------------------- 1 files changed, 1 insertions(+), 21 deletions(-)
net/netlabel/netlabel_unlabeled.c +1 -21
@@ -153,26 +153,6 @@ static const struct nla_policy netlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1* Unlabeled Connection Hash Table Functions */ -#if defined(CONFIG_IPV6 ) || defined(CONFIG_IPV6_MODULE ) -/** -* netlbl_unlhsh_free_addr6 - Frees an IPv6 address entry from the hash table -* @entry: the entry's RCU field -* -* Description: -* This function is designed to be used as a callback to the call_rcu() -* function so that memory allocated to a hash table address entry can be -* released safely. -* -*/ -static void netlbl_unlhsh_free_addr6 (struct rcu_head *entry) -{ -struct netlbl_unlhsh_addr6 *ptr; - - ptr = container_of(entry, struct netlbl_unlhsh_addr6, rcu); -kfree (ptr); -} -#endif /* IPv6 */ -/** * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table * @entry: the entry's RCU field
@@ -611,7 +591,7 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,if (entry ==NULL )return -ENOENT ; -call_rcu (&entry->rcu, netlbl_unlhsh_free_addr6); +kfree_rcu (entry, rcu); return 0; }#endif /* IPv6 */
Signature · 1 line
1.7.4
Quoted 4 lines · Lai Jiangshan
The rcu callback
netlbl_unlhsh_free_addr6()just calls akfree(), so we usekfree_rcu()instead of thecall_rcu(netlbl_unlhsh_free_addr6).Signed-off-by Lai Jiangshan <[email protected]>
Quoted 37 lines
--- net/netlabel/netlabel_unlabeled.c | 22 +--------------------- 1 files changed, 1 insertions(+), 21 deletions(-)(quoted diff) +0
-0
b/net/netlabel/netlabel_unlabeled.cindex 4e5ad90..9c38658 100644net/netlabel/netlabel_unlabeled.c +0
-0@@ -153,26 +153,6 @@ static const struct nla_policynetlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1 * Unlabeled Connection Hash Table Functions
*/net/netlabel/netlabel_unlabeled.c +0
-3-#if defined(CONFIG_IPV6 ) || defined(CONFIG_IPV6_MODULE ) -/** -* netlbl_unlhsh_free_addr6 - Frees an IPv6 address entry from the hash table - * @entry: the entry's RCU field
- *
- * Description:
- * This function is designed to be used as a callback to thecall_rcu()
- * function so that memory allocated to a hash table address entry can be
- * released safely.
- *
- */net/netlabel/netlabel_unlabeled.c +0
-9-static void netlbl_unlhsh_free_addr6 (struct rcu_head *entry) -{ -struct netlbl_unlhsh_addr6 *ptr; - - ptr = container_of(entry, struct netlbl_unlhsh_addr6, rcu); -kfree (ptr); -} -#endif /* IPv6 */ -/** * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table * @entry: the entry's RCU field
net/netlabel/netlabel_unlabeled.c static int netlbl_unlhsh_remove_addr6(struct net *net, · line 597
Quoted 8 lines
net/netlabel/netlabel_unlabeled.c +1
-1@@ -611,7 +591,7 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,if (entry ==NULL )return -ENOENT ; -call_rcu (&entry->rcu, netlbl_unlhsh_free_addr6); +kfree_rcu (entry, rcu); return 0; }#endif /* IPv6 */
--
paul moore
linux @ hp