diff options
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/dccp.h | 1 | ||||
-rw-r--r-- | net/dccp/output.c | 16 | ||||
-rw-r--r-- | net/dccp/timer.c | 25 |
3 files changed, 26 insertions, 16 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index e33a9edb4036..a0e7cd183a5d 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h @@ -191,6 +191,7 @@ extern void dccp_send_sync(struct sock *sk, const u64 seq, const enum dccp_pkt_type pkt_type); extern void dccp_write_xmit(struct sock *sk, int block); +extern void dccp_write_xmit_timer(unsigned long data); extern void dccp_write_space(struct sock *sk); extern void dccp_init_xmit_timers(struct sock *sk); diff --git a/net/dccp/output.c b/net/dccp/output.c index 3282f2f2291b..aa21cc4de37f 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c @@ -213,19 +213,6 @@ do_interrupted: goto out; } -static void dccp_write_xmit_timer(unsigned long data) { - struct sock *sk = (struct sock *)data; - struct dccp_sock *dp = dccp_sk(sk); - - bh_lock_sock(sk); - if (sock_owned_by_user(sk)) - sk_reset_timer(sk, &dp->dccps_xmit_timer, jiffies+1); - else - dccp_write_xmit(sk, 0); - bh_unlock_sock(sk); - sock_put(sk); -} - void dccp_write_xmit(struct sock *sk, int block) { struct dccp_sock *dp = dccp_sk(sk); @@ -434,9 +421,6 @@ static inline void dccp_connect_init(struct sock *sk) dp->dccps_gar = dp->dccps_iss; icsk->icsk_retransmits = 0; - init_timer(&dp->dccps_xmit_timer); - dp->dccps_xmit_timer.data = (unsigned long)sk; - dp->dccps_xmit_timer.function = dccp_write_xmit_timer; } int dccp_connect(struct sock *sk) diff --git a/net/dccp/timer.c b/net/dccp/timer.c index 41ea0f6594c4..b038a0a3ad40 100644 --- a/net/dccp/timer.c +++ b/net/dccp/timer.c @@ -261,8 +261,33 @@ out: sock_put(sk); } +/* Transmit-delay timer: used by the CCIDs to delay actual send time */ +void dccp_write_xmit_timer(unsigned long data) +{ + struct sock *sk = (struct sock *)data; + struct dccp_sock *dp = dccp_sk(sk); + + bh_lock_sock(sk); + if (sock_owned_by_user(sk)) + sk_reset_timer(sk, &dp->dccps_xmit_timer, jiffies+1); + else + dccp_write_xmit(sk, 0); + bh_unlock_sock(sk); + sock_put(sk); +} + +static void dccp_init_write_xmit_timer(struct sock *sk) +{ + struct dccp_sock *dp = dccp_sk(sk); + + init_timer(&dp->dccps_xmit_timer); + dp->dccps_xmit_timer.data = (unsigned long)sk; + dp->dccps_xmit_timer.function = dccp_write_xmit_timer; +} + void dccp_init_xmit_timers(struct sock *sk) { + dccp_init_write_xmit_timer(sk); inet_csk_init_xmit_timers(sk, &dccp_write_timer, &dccp_delack_timer, &dccp_keepalive_timer); } |