diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2010-11-30 19:19:46 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 13:24:29 -0500 |
commit | c47036a7cd378533495d8cc06a7cf8a881072a9d (patch) | |
tree | 6c2cfa3216a04b23c0b0e623827fc39f57db576e /drivers/scsi/fcoe | |
parent | 69316ee2e375c5af0cf1f8d2d30f9aa277f0b454 (diff) |
[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 <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe')
-rw-r--r-- | drivers/scsi/fcoe/libfcoe.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c index 26381f00e4e5..4d0be20cb73d 100644 --- a/drivers/scsi/fcoe/libfcoe.c +++ b/drivers/scsi/fcoe/libfcoe.c | |||
@@ -1391,6 +1391,13 @@ static void fcoe_ctlr_select(struct fcoe_ctlr *fip) | |||
1391 | best = fcf; | 1391 | best = fcf; |
1392 | } | 1392 | } |
1393 | fip->sel_fcf = best; | 1393 | 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 | } | ||
1394 | } | 1401 | } |
1395 | 1402 | ||
1396 | /** | 1403 | /** |
@@ -1449,9 +1456,6 @@ static void fcoe_ctlr_timer_work(struct work_struct *work) | |||
1449 | fcf = sel; /* the old FCF may have been freed */ | 1456 | fcf = sel; /* the old FCF may have been freed */ |
1450 | fcoe_ctlr_announce(fip); | 1457 | fcoe_ctlr_announce(fip); |
1451 | if (sel) { | 1458 | 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; | ||
1455 | if (time_after(next_timer, fip->ctlr_ka_time)) | 1459 | if (time_after(next_timer, fip->ctlr_ka_time)) |
1456 | next_timer = fip->ctlr_ka_time; | 1460 | next_timer = fip->ctlr_ka_time; |
1457 | } else | 1461 | } else |