Commit c47036a7 authored by Joe Eykholt's avatar Joe Eykholt Committed by James Bottomley

[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: default avatarJoe Eykholt <jeykholt@cisco.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 69316ee2
...@@ -1391,6 +1391,13 @@ static void fcoe_ctlr_select(struct fcoe_ctlr *fip) ...@@ -1391,6 +1391,13 @@ static void fcoe_ctlr_select(struct fcoe_ctlr *fip)
best = fcf; best = fcf;
} }
fip->sel_fcf = best; fip->sel_fcf = best;
if (best) {
fip->port_ka_time = jiffies +
msecs_to_jiffies(FIP_VN_KA_PERIOD);
fip->ctlr_ka_time = jiffies + best->fka_period;
if (time_before(fip->ctlr_ka_time, fip->timer.expires))
mod_timer(&fip->timer, fip->ctlr_ka_time);
}
} }
/** /**
...@@ -1449,9 +1456,6 @@ static void fcoe_ctlr_timer_work(struct work_struct *work) ...@@ -1449,9 +1456,6 @@ static void fcoe_ctlr_timer_work(struct work_struct *work)
fcf = sel; /* the old FCF may have been freed */ fcf = sel; /* the old FCF may have been freed */
fcoe_ctlr_announce(fip); fcoe_ctlr_announce(fip);
if (sel) { if (sel) {
fip->port_ka_time = jiffies +
msecs_to_jiffies(FIP_VN_KA_PERIOD);
fip->ctlr_ka_time = jiffies + sel->fka_period;
if (time_after(next_timer, fip->ctlr_ka_time)) if (time_after(next_timer, fip->ctlr_ka_time))
next_timer = fip->ctlr_ka_time; next_timer = fip->ctlr_ka_time;
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment