aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2007-04-20 20:11:46 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:29:25 -0400
commit4ac02bab77438b484a5cf855a002fb6a1d592894 (patch)
tree8a7442a9c9fa39e147eca0f0728a0691712b191a
parent3ff50b7997fe06cd5d276b229967bb52d6b3b6c1 (diff)
[TCP]: Uninline tcp_done().
The function is quite big and has several call sites and nothing to collapse by compiler optimization on inlining. Besides it's nicer to read in a in .c file. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/tcp.h16
-rw-r--r--net/ipv4/tcp.c17
2 files changed, 18 insertions, 15 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 07f724e02f84..e79803353c83 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -921,21 +921,7 @@ static inline void tcp_set_state(struct sock *sk, int state)
921#endif 921#endif
922} 922}
923 923
924static inline void tcp_done(struct sock *sk) 924extern void tcp_done(struct sock *sk);
925{
926 if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV)
927 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
928
929 tcp_set_state(sk, TCP_CLOSE);
930 tcp_clear_xmit_timers(sk);
931
932 sk->sk_shutdown = SHUTDOWN_MASK;
933
934 if (!sock_flag(sk, SOCK_DEAD))
935 sk->sk_state_change(sk);
936 else
937 inet_csk_destroy_sock(sk);
938}
939 925
940static inline void tcp_sack_reset(struct tcp_options_received *rx_opt) 926static inline void tcp_sack_reset(struct tcp_options_received *rx_opt)
941{ 927{
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4664733f139c..99ad52c00c96 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2375,6 +2375,23 @@ void __tcp_put_md5sig_pool(void)
2375EXPORT_SYMBOL(__tcp_put_md5sig_pool); 2375EXPORT_SYMBOL(__tcp_put_md5sig_pool);
2376#endif 2376#endif
2377 2377
2378void tcp_done(struct sock *sk)
2379{
2380 if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV)
2381 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
2382
2383 tcp_set_state(sk, TCP_CLOSE);
2384 tcp_clear_xmit_timers(sk);
2385
2386 sk->sk_shutdown = SHUTDOWN_MASK;
2387
2388 if (!sock_flag(sk, SOCK_DEAD))
2389 sk->sk_state_change(sk);
2390 else
2391 inet_csk_destroy_sock(sk);
2392}
2393EXPORT_SYMBOL_GPL(tcp_done);
2394
2378extern void __skb_cb_too_small_for_tcp(int, int); 2395extern void __skb_cb_too_small_for_tcp(int, int);
2379extern struct tcp_congestion_ops tcp_reno; 2396extern struct tcp_congestion_ops tcp_reno;
2380 2397