aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-03-16 00:12:15 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-16 15:55:29 -0400
commit2c13270b441054a9596bcd99c0f446603c9ad131 (patch)
tree4e142a3fc6b9f60dbc7c96ed0af1c329ef380de2
parenta58917f584e776b9fe31ef2a8bf617f253378dc0 (diff)
inet: factorize sock_edemux()/sock_gen_put() code
sock_edemux() is not used in fast path, and should really call sock_gen_put() to save some code. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/sock.c15
-rw-r--r--net/ipv4/inet_hashtables.c6
2 files changed, 6 insertions, 15 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 4bc42efb3e40..a950b54248da 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1661,21 +1661,6 @@ void sock_efree(struct sk_buff *skb)
1661} 1661}
1662EXPORT_SYMBOL(sock_efree); 1662EXPORT_SYMBOL(sock_efree);
1663 1663
1664#ifdef CONFIG_INET
1665void sock_edemux(struct sk_buff *skb)
1666{
1667 struct sock *sk = skb->sk;
1668
1669 if (sk->sk_state == TCP_TIME_WAIT)
1670 inet_twsk_put(inet_twsk(sk));
1671 else if (sk->sk_state == TCP_NEW_SYN_RECV)
1672 reqsk_put(inet_reqsk(sk));
1673 else
1674 sock_put(sk);
1675}
1676EXPORT_SYMBOL(sock_edemux);
1677#endif
1678
1679kuid_t sock_i_uid(struct sock *sk) 1664kuid_t sock_i_uid(struct sock *sk)
1680{ 1665{
1681 kuid_t uid; 1666 kuid_t uid;
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index 64401a2fdd33..c28bca4cc15b 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -269,6 +269,12 @@ void sock_gen_put(struct sock *sk)
269} 269}
270EXPORT_SYMBOL_GPL(sock_gen_put); 270EXPORT_SYMBOL_GPL(sock_gen_put);
271 271
272void sock_edemux(struct sk_buff *skb)
273{
274 sock_gen_put(skb->sk);
275}
276EXPORT_SYMBOL(sock_edemux);
277
272struct sock *__inet_lookup_established(struct net *net, 278struct sock *__inet_lookup_established(struct net *net,
273 struct inet_hashinfo *hashinfo, 279 struct inet_hashinfo *hashinfo,
274 const __be32 saddr, const __be16 sport, 280 const __be32 saddr, const __be16 sport,