Skip to content

Commit c47036a

Browse files
Joe EykholtJames Bottomley
authored andcommitted
[SCSI] libfcoe: move some timer code to make it reusable.
Move some of the code in fcoe_ctlr_timer_work() to fcoe_ctlr_select() so that it can be shared with another function in a forthcoming patch. Signed-off-by: Joe Eykholt <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent 69316ee commit c47036a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/scsi/fcoe/libfcoe.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,13 @@ static void fcoe_ctlr_select(struct fcoe_ctlr *fip)
13911391
best = fcf;
13921392
}
13931393
fip->sel_fcf = best;
1394+
if (best) {
1395+
fip->port_ka_time = jiffies +
1396+
msecs_to_jiffies(FIP_VN_KA_PERIOD);
1397+
fip->ctlr_ka_time = jiffies + best->fka_period;
1398+
if (time_before(fip->ctlr_ka_time, fip->timer.expires))
1399+
mod_timer(&fip->timer, fip->ctlr_ka_time);
1400+
}
13941401
}
13951402

13961403
/**
@@ -1449,9 +1456,6 @@ static void fcoe_ctlr_timer_work(struct work_struct *work)
14491456
fcf = sel; /* the old FCF may have been freed */
14501457
fcoe_ctlr_announce(fip);
14511458
if (sel) {
1452-
fip->port_ka_time = jiffies +
1453-
msecs_to_jiffies(FIP_VN_KA_PERIOD);
1454-
fip->ctlr_ka_time = jiffies + sel->fka_period;
14551459
if (time_after(next_timer, fip->ctlr_ka_time))
14561460
next_timer = fip->ctlr_ka_time;
14571461
} else

0 commit comments

Comments
 (0)