Skip to content

Commit

Permalink
ipv4: Convert call_rcu() to kfree_rcu(), drop opt_kfree_rcu
Browse files Browse the repository at this point in the history
The call_rcu() in do_ip_setsockopt() invokes opt_kfree_rcu(), which just
calls kfree().  So convert the call_rcu() to kfree_rcu(), which allows
opt_kfree_rcu() to be eliminated.

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org
  • Loading branch information
Paul E. McKenney authored and Paul E. McKenney committed Feb 21, 2012
1 parent 4f9c8c1 commit 605b4af
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions net/ipv4/ip_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,6 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len)
}


static void opt_kfree_rcu(struct rcu_head *head)
{
kfree(container_of(head, struct ip_options_rcu, rcu));
}

/*
* Socket option code for IP. This is the end of the line after any
* TCP,UDP etc options on an IP socket.
Expand Down Expand Up @@ -525,7 +520,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
}
rcu_assign_pointer(inet->inet_opt, opt);
if (old)
call_rcu(&old->rcu, opt_kfree_rcu);
kfree_rcu(old, rcu);
break;
}
case IP_PKTINFO:
Expand Down

0 comments on commit 605b4af

Please sign in to comment.