diff options
Diffstat (limited to 'net/dccp/timer.c')
| -rw-r--r-- | net/dccp/timer.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/net/dccp/timer.c b/net/dccp/timer.c index 1a9aa05d4dc4..916f9d1dab36 100644 --- a/net/dccp/timer.c +++ b/net/dccp/timer.c | |||
| @@ -237,32 +237,35 @@ out: | |||
| 237 | sock_put(sk); | 237 | sock_put(sk); |
| 238 | } | 238 | } |
| 239 | 239 | ||
| 240 | /* Transmit-delay timer: used by the CCIDs to delay actual send time */ | 240 | /** |
| 241 | static void dccp_write_xmit_timer(unsigned long data) | 241 | * dccp_write_xmitlet - Workhorse for CCID packet dequeueing interface |
| 242 | * See the comments above %ccid_dequeueing_decision for supported modes. | ||
| 243 | */ | ||
| 244 | static void dccp_write_xmitlet(unsigned long data) | ||
| 242 | { | 245 | { |
| 243 | struct sock *sk = (struct sock *)data; | 246 | struct sock *sk = (struct sock *)data; |
| 244 | struct dccp_sock *dp = dccp_sk(sk); | ||
| 245 | 247 | ||
| 246 | bh_lock_sock(sk); | 248 | bh_lock_sock(sk); |
| 247 | if (sock_owned_by_user(sk)) | 249 | if (sock_owned_by_user(sk)) |
| 248 | sk_reset_timer(sk, &dp->dccps_xmit_timer, jiffies+1); | 250 | sk_reset_timer(sk, &dccp_sk(sk)->dccps_xmit_timer, jiffies + 1); |
| 249 | else | 251 | else |
| 250 | dccp_write_xmit(sk, 0); | 252 | dccp_write_xmit(sk, 0); |
| 251 | bh_unlock_sock(sk); | 253 | bh_unlock_sock(sk); |
| 252 | sock_put(sk); | ||
| 253 | } | 254 | } |
| 254 | 255 | ||
| 255 | static void dccp_init_write_xmit_timer(struct sock *sk) | 256 | static void dccp_write_xmit_timer(unsigned long data) |
| 256 | { | 257 | { |
| 257 | struct dccp_sock *dp = dccp_sk(sk); | 258 | dccp_write_xmitlet(data); |
| 258 | 259 | sock_put((struct sock *)data); | |
| 259 | setup_timer(&dp->dccps_xmit_timer, dccp_write_xmit_timer, | ||
| 260 | (unsigned long)sk); | ||
| 261 | } | 260 | } |
| 262 | 261 | ||
| 263 | void dccp_init_xmit_timers(struct sock *sk) | 262 | void dccp_init_xmit_timers(struct sock *sk) |
| 264 | { | 263 | { |
| 265 | dccp_init_write_xmit_timer(sk); | 264 | struct dccp_sock *dp = dccp_sk(sk); |
| 265 | |||
| 266 | tasklet_init(&dp->dccps_xmitlet, dccp_write_xmitlet, (unsigned long)sk); | ||
| 267 | setup_timer(&dp->dccps_xmit_timer, dccp_write_xmit_timer, | ||
| 268 | (unsigned long)sk); | ||
| 266 | inet_csk_init_xmit_timers(sk, &dccp_write_timer, &dccp_delack_timer, | 269 | inet_csk_init_xmit_timers(sk, &dccp_write_timer, &dccp_delack_timer, |
| 267 | &dccp_keepalive_timer); | 270 | &dccp_keepalive_timer); |
| 268 | } | 271 | } |
