diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2012-01-06 20:06:11 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-02-21 12:03:31 -0500 |
commit | 4f9c8c1b091628a550b70ee51d7d729187f5c290 (patch) | |
tree | 2ce74534f850815825cd047882a166d17e82f028 /net/ipv4/cipso_ipv4.c | |
parent | a6c76da8f8b4549ccec7425ba94d8395d68a2e56 (diff) |
ipv4: Convert call_rcu() to kfree_rcu(), drop opt_kfree_rcu()
Because opt_kfree_rcu() just calls kfree(), all call_rcu() uses of it
may be converted to kfree_rcu(). This permits 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
Diffstat (limited to 'net/ipv4/cipso_ipv4.c')
-rw-r--r-- | net/ipv4/cipso_ipv4.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index 86f3b885b4f3..c48adc565e92 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c | |||
@@ -1857,11 +1857,6 @@ static int cipso_v4_genopt(unsigned char *buf, u32 buf_len, | |||
1857 | return CIPSO_V4_HDR_LEN + ret_val; | 1857 | return CIPSO_V4_HDR_LEN + ret_val; |
1858 | } | 1858 | } |
1859 | 1859 | ||
1860 | static void opt_kfree_rcu(struct rcu_head *head) | ||
1861 | { | ||
1862 | kfree(container_of(head, struct ip_options_rcu, rcu)); | ||
1863 | } | ||
1864 | |||
1865 | /** | 1860 | /** |
1866 | * cipso_v4_sock_setattr - Add a CIPSO option to a socket | 1861 | * cipso_v4_sock_setattr - Add a CIPSO option to a socket |
1867 | * @sk: the socket | 1862 | * @sk: the socket |
@@ -1938,7 +1933,7 @@ int cipso_v4_sock_setattr(struct sock *sk, | |||
1938 | } | 1933 | } |
1939 | rcu_assign_pointer(sk_inet->inet_opt, opt); | 1934 | rcu_assign_pointer(sk_inet->inet_opt, opt); |
1940 | if (old) | 1935 | if (old) |
1941 | call_rcu(&old->rcu, opt_kfree_rcu); | 1936 | kfree_rcu(old, rcu); |
1942 | 1937 | ||
1943 | return 0; | 1938 | return 0; |
1944 | 1939 | ||
@@ -2005,7 +2000,7 @@ int cipso_v4_req_setattr(struct request_sock *req, | |||
2005 | req_inet = inet_rsk(req); | 2000 | req_inet = inet_rsk(req); |
2006 | opt = xchg(&req_inet->opt, opt); | 2001 | opt = xchg(&req_inet->opt, opt); |
2007 | if (opt) | 2002 | if (opt) |
2008 | call_rcu(&opt->rcu, opt_kfree_rcu); | 2003 | kfree_rcu(opt, rcu); |
2009 | 2004 | ||
2010 | return 0; | 2005 | return 0; |
2011 | 2006 | ||
@@ -2075,7 +2070,7 @@ static int cipso_v4_delopt(struct ip_options_rcu **opt_ptr) | |||
2075 | * remove the entire option struct */ | 2070 | * remove the entire option struct */ |
2076 | *opt_ptr = NULL; | 2071 | *opt_ptr = NULL; |
2077 | hdr_delta = opt->opt.optlen; | 2072 | hdr_delta = opt->opt.optlen; |
2078 | call_rcu(&opt->rcu, opt_kfree_rcu); | 2073 | kfree_rcu(opt, rcu); |
2079 | } | 2074 | } |
2080 | 2075 | ||
2081 | return hdr_delta; | 2076 | return hdr_delta; |