ipv4: Convert call_rcu() to kfree_rcu(), drop opt_kfree_rcu
authorPaul E. McKenney <paul.mckenney@linaro.org>
Sat, 7 Jan 2012 01:08:33 +0000 (17:08 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 21 Feb 2012 17:03:32 +0000 (09:03 -0800)
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
net/ipv4/ip_sockglue.c

index 8aa87c19fa008f00adbcf8e0fa1b4411d119288b..5343d9ac510b58c4c1dd137f8b49d8a3790c193b 100644 (file)
@@ -445,11 +445,6 @@ out:
 }
 
 
-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.
@@ -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: