Commit 217f1863 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Paul E. McKenney

net,rcu: convert call_rcu(ha_rcu_free) to kfree_rcu()

The rcu callback ha_rcu_free() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(ha_rcu_free).
Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent 1231f0ba
...@@ -68,14 +68,6 @@ static int __hw_addr_add(struct netdev_hw_addr_list *list, unsigned char *addr, ...@@ -68,14 +68,6 @@ static int __hw_addr_add(struct netdev_hw_addr_list *list, unsigned char *addr,
return __hw_addr_add_ex(list, addr, addr_len, addr_type, false); return __hw_addr_add_ex(list, addr, addr_len, addr_type, false);
} }
static void ha_rcu_free(struct rcu_head *head)
{
struct netdev_hw_addr *ha;
ha = container_of(head, struct netdev_hw_addr, rcu_head);
kfree(ha);
}
static int __hw_addr_del_ex(struct netdev_hw_addr_list *list, static int __hw_addr_del_ex(struct netdev_hw_addr_list *list,
unsigned char *addr, int addr_len, unsigned char *addr, int addr_len,
unsigned char addr_type, bool global) unsigned char addr_type, bool global)
...@@ -94,7 +86,7 @@ static int __hw_addr_del_ex(struct netdev_hw_addr_list *list, ...@@ -94,7 +86,7 @@ static int __hw_addr_del_ex(struct netdev_hw_addr_list *list,
if (--ha->refcount) if (--ha->refcount)
return 0; return 0;
list_del_rcu(&ha->list); list_del_rcu(&ha->list);
call_rcu(&ha->rcu_head, ha_rcu_free); kfree_rcu(ha, rcu_head);
list->count--; list->count--;
return 0; return 0;
} }
...@@ -197,7 +189,7 @@ void __hw_addr_flush(struct netdev_hw_addr_list *list) ...@@ -197,7 +189,7 @@ void __hw_addr_flush(struct netdev_hw_addr_list *list)
list_for_each_entry_safe(ha, tmp, &list->list, list) { list_for_each_entry_safe(ha, tmp, &list->list, list) {
list_del_rcu(&ha->list); list_del_rcu(&ha->list);
call_rcu(&ha->rcu_head, ha_rcu_free); kfree_rcu(ha, rcu_head);
} }
list->count = 0; list->count = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment