Skip to content

Commit

Permalink
net: dccp: convert tasklets to use new tasklet_setup() API
Browse files Browse the repository at this point in the history
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
allenpais authored and kuba-moo committed Nov 7, 2020
1 parent ae0d0bb commit fccf290
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/dccp/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,14 @@ static void dccp_delack_timer(struct timer_list *t)

/**
* dccp_write_xmitlet - Workhorse for CCID packet dequeueing interface
* @data: Socket to act on
* @t: pointer to the tasklet associated with this handler
*
* See the comments above %ccid_dequeueing_decision for supported modes.
*/
static void dccp_write_xmitlet(unsigned long data)
static void dccp_write_xmitlet(struct tasklet_struct *t)
{
struct sock *sk = (struct sock *)data;
struct dccp_sock *dp = from_tasklet(dp, t, dccps_xmitlet);
struct sock *sk = &dp->dccps_inet_connection.icsk_inet.sk;

bh_lock_sock(sk);
if (sock_owned_by_user(sk))
Expand All @@ -235,16 +236,15 @@ static void dccp_write_xmitlet(unsigned long data)
static void dccp_write_xmit_timer(struct timer_list *t)
{
struct dccp_sock *dp = from_timer(dp, t, dccps_xmit_timer);
struct sock *sk = &dp->dccps_inet_connection.icsk_inet.sk;

dccp_write_xmitlet((unsigned long)sk);
dccp_write_xmitlet(&dp->dccps_xmitlet);
}

void dccp_init_xmit_timers(struct sock *sk)
{
struct dccp_sock *dp = dccp_sk(sk);

tasklet_init(&dp->dccps_xmitlet, dccp_write_xmitlet, (unsigned long)sk);
tasklet_setup(&dp->dccps_xmitlet, dccp_write_xmitlet);
timer_setup(&dp->dccps_xmit_timer, dccp_write_xmit_timer, 0);
inet_csk_init_xmit_timers(sk, &dccp_write_timer, &dccp_delack_timer,
&dccp_keepalive_timer);
Expand Down

0 comments on commit fccf290

Please sign in to comment.