aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r--net/ipv4/tcp_timer.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 7014cc00c74c..804a8d34ce86 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -288,15 +288,17 @@ out:
288 * 288 *
289 * Returns: Nothing (void) 289 * Returns: Nothing (void)
290 */ 290 */
291static void tcp_delack_timer(unsigned long data) 291static void tcp_delack_timer(struct timer_list *t)
292{ 292{
293 struct sock *sk = (struct sock *)data; 293 struct inet_connection_sock *icsk =
294 from_timer(icsk, t, icsk_delack_timer);
295 struct sock *sk = &icsk->icsk_inet.sk;
294 296
295 bh_lock_sock(sk); 297 bh_lock_sock(sk);
296 if (!sock_owned_by_user(sk)) { 298 if (!sock_owned_by_user(sk)) {
297 tcp_delack_timer_handler(sk); 299 tcp_delack_timer_handler(sk);
298 } else { 300 } else {
299 inet_csk(sk)->icsk_ack.blocked = 1; 301 icsk->icsk_ack.blocked = 1;
300 __NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED); 302 __NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED);
301 /* deleguate our work to tcp_release_cb() */ 303 /* deleguate our work to tcp_release_cb() */
302 if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED, &sk->sk_tsq_flags)) 304 if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED, &sk->sk_tsq_flags))
@@ -576,9 +578,11 @@ out:
576 sk_mem_reclaim(sk); 578 sk_mem_reclaim(sk);
577} 579}
578 580
579static void tcp_write_timer(unsigned long data) 581static void tcp_write_timer(struct timer_list *t)
580{ 582{
581 struct sock *sk = (struct sock *)data; 583 struct inet_connection_sock *icsk =
584 from_timer(icsk, t, icsk_retransmit_timer);
585 struct sock *sk = &icsk->icsk_inet.sk;
582 586
583 bh_lock_sock(sk); 587 bh_lock_sock(sk);
584 if (!sock_owned_by_user(sk)) { 588 if (!sock_owned_by_user(sk)) {
@@ -613,9 +617,9 @@ void tcp_set_keepalive(struct sock *sk, int val)
613EXPORT_SYMBOL_GPL(tcp_set_keepalive); 617EXPORT_SYMBOL_GPL(tcp_set_keepalive);
614 618
615 619
616static void tcp_keepalive_timer (unsigned long data) 620static void tcp_keepalive_timer (struct timer_list *t)
617{ 621{
618 struct sock *sk = (struct sock *) data; 622 struct sock *sk = from_timer(sk, t, sk_timer);
619 struct inet_connection_sock *icsk = inet_csk(sk); 623 struct inet_connection_sock *icsk = inet_csk(sk);
620 struct tcp_sock *tp = tcp_sk(sk); 624 struct tcp_sock *tp = tcp_sk(sk);
621 u32 elapsed; 625 u32 elapsed;