Commit 4ac02bab authored by Andi Kleen's avatar Andi Kleen Committed by David S. Miller

[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: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3ff50b79
...@@ -921,21 +921,7 @@ static inline void tcp_set_state(struct sock *sk, int state) ...@@ -921,21 +921,7 @@ static inline void tcp_set_state(struct sock *sk, int state)
#endif #endif
} }
static inline void tcp_done(struct sock *sk) extern void tcp_done(struct sock *sk);
{
if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV)
TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
tcp_set_state(sk, TCP_CLOSE);
tcp_clear_xmit_timers(sk);
sk->sk_shutdown = SHUTDOWN_MASK;
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_state_change(sk);
else
inet_csk_destroy_sock(sk);
}
static inline void tcp_sack_reset(struct tcp_options_received *rx_opt) static inline void tcp_sack_reset(struct tcp_options_received *rx_opt)
{ {
......
...@@ -2375,6 +2375,23 @@ void __tcp_put_md5sig_pool(void) ...@@ -2375,6 +2375,23 @@ void __tcp_put_md5sig_pool(void)
EXPORT_SYMBOL(__tcp_put_md5sig_pool); EXPORT_SYMBOL(__tcp_put_md5sig_pool);
#endif #endif
void tcp_done(struct sock *sk)
{
if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV)
TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
tcp_set_state(sk, TCP_CLOSE);
tcp_clear_xmit_timers(sk);
sk->sk_shutdown = SHUTDOWN_MASK;
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_state_change(sk);
else
inet_csk_destroy_sock(sk);
}
EXPORT_SYMBOL_GPL(tcp_done);
extern void __skb_cb_too_small_for_tcp(int, int); extern void __skb_cb_too_small_for_tcp(int, int);
extern struct tcp_congestion_ops tcp_reno; extern struct tcp_congestion_ops tcp_reno;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment