diff options
author | Tejun Heo <tj@kernel.org> | 2012-08-21 16:18:24 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-08-21 16:18:24 -0400 |
commit | e7c2f967445dd2041f0f8e3179cca22bb8bb7f79 (patch) | |
tree | cb6c1d3593d2497e740d313f55592f41e8ae2039 /drivers/block | |
parent | e0aecdd874d78b7129a64b056c20e529e2c916df (diff) |
workqueue: use mod_delayed_work() instead of __cancel + queue
Now that mod_delayed_work() is safe to call from IRQ handlers,
__cancel_delayed_work() followed by queue_delayed_work() can be
replaced with mod_delayed_work().
Most conversions are straight-forward except for the following.
* net/core/link_watch.c: linkwatch_schedule_work() was doing a quite
elaborate dancing around its delayed_work. Collapse it such that
linkwatch_work is queued for immediate execution if LW_URGENT and
existing timer is kept otherwise.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/floppy.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index a7d6347aaa79..55a5bc002c06 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -672,7 +672,6 @@ static void __reschedule_timeout(int drive, const char *message) | |||
672 | 672 | ||
673 | if (drive == current_reqD) | 673 | if (drive == current_reqD) |
674 | drive = current_drive; | 674 | drive = current_drive; |
675 | __cancel_delayed_work(&fd_timeout); | ||
676 | 675 | ||
677 | if (drive < 0 || drive >= N_DRIVE) { | 676 | if (drive < 0 || drive >= N_DRIVE) { |
678 | delay = 20UL * HZ; | 677 | delay = 20UL * HZ; |
@@ -680,7 +679,7 @@ static void __reschedule_timeout(int drive, const char *message) | |||
680 | } else | 679 | } else |
681 | delay = UDP->timeout; | 680 | delay = UDP->timeout; |
682 | 681 | ||
683 | queue_delayed_work(floppy_wq, &fd_timeout, delay); | 682 | mod_delayed_work(floppy_wq, &fd_timeout, delay); |
684 | if (UDP->flags & FD_DEBUG) | 683 | if (UDP->flags & FD_DEBUG) |
685 | DPRINT("reschedule timeout %s\n", message); | 684 | DPRINT("reschedule timeout %s\n", message); |
686 | timeout_message = message; | 685 | timeout_message = message; |