workqueue: make deferrable delayed_work initializer names consistent

Change-Id: Id89427416cab477312971d4a32198b84c02e5ed7
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
 workqueue: implement mod_delayed_work[_on]() Workqueue was
 lacking a mechanism to modify the timeout of an already pending delayed_work.
  delayed_work users have been working around this using several methods -
 using an explicit timer + work item, messing directly with
 delayed_work->timer, and canceling before re-queueing, all of which are
 error-prone and/or ugly.

This patch implements mod_delayed_work[_on]() which behaves similarly
to mod_timer() - if the delayed_work is idle, it's queued with the
given delay; otherwise, its timeout is modified to the new value.
Zero @delay guarantees immediate execution.

Change-Id: I0e472f1d94b03da6deb4f20c95062ae9e1c8e0e9
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
workqueue: factor out __queue_delayed_work() from
 queue_delayed_work_on()

This is to prepare for mod_delayed_work[_on]() and doesn't cause any
functional difference.

Change-Id: Ib5cf80f0e440cd6e5bd91d81e90e644d3b974add
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
Fix typo

Change-Id: Ib051394b817752f323dc428179b4f515611e6548
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>
 workqueue: reorganize try_to_grab_pending() and __cancel_timer_work()

* Move timer handling from __cancel_work_timer() to
  try_to_grab_pending().

* Make try_to_grab_pending() use -EAGAIN instead of -1 for
  busy-looping and drop the ret local variable.

* Add proper function comment to try_to_grab_pending().

This makes the code a bit easier to understand and will ease further
changes.  This patch doesn't make any functional change.

Change-Id: I0c8a735b1ea1efc513838bbdf8b1425bef3bc145
Signed-off-by: klozz <xxx.reptar.rawrr.xxx@gmail.com>