Skip to content

Commit

Permalink
net,rcu: convert call_rcu(listeners_free_rcu) to kfree_rcu()
Browse files Browse the repository at this point in the history
The rcu callback listeners_free_rcu() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(listeners_free_rcu).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
  • Loading branch information
Lai Jiangshan authored and Paul E. McKenney committed May 8, 2011
1 parent e578598 commit 37b6b93
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,12 +1566,6 @@ netlink_kernel_release(struct sock *sk)
}
EXPORT_SYMBOL(netlink_kernel_release);


static void listeners_free_rcu(struct rcu_head *head)
{
kfree(container_of(head, struct listeners, rcu));
}

int __netlink_change_ngroups(struct sock *sk, unsigned int groups)
{
struct listeners *new, *old;
Expand All @@ -1588,7 +1582,7 @@ int __netlink_change_ngroups(struct sock *sk, unsigned int groups)
memcpy(new->masks, old->masks, NLGRPSZ(tbl->groups));
rcu_assign_pointer(tbl->listeners, new);

call_rcu(&old->rcu, listeners_free_rcu);
kfree_rcu(old, rcu);
}
tbl->groups = groups;

Expand Down

0 comments on commit 37b6b93

Please sign in to comment.