diff options
author | Alex Elder <elder@inktank.com> | 2012-10-08 20:37:30 -0700 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2012-10-09 22:00:44 -0700 |
commit | 802c6d967fbdcd2cbc91b917425661bb8bbfaade (patch) | |
tree | a5a64ac537fb69ecb1edd55db8346089fecb9f84 /net/atm/atm_sysfs.c | |
parent | 8618e30bc14b06bfafa0f164cca7b0e06451f88a (diff) | |
download | op-kernel-dev-802c6d967fbdcd2cbc91b917425661bb8bbfaade.zip op-kernel-dev-802c6d967fbdcd2cbc91b917425661bb8bbfaade.tar.gz |
rbd: define common queue_con_delay()
This patch defines a single function, queue_con_delay() to call
queue_delayed_work() for a connection. It basically generalizes
what was previously queue_con() by adding the delay argument.
queue_con() is now a simple helper that passes 0 for its delay.
queue_con_delay() returns 0 if it queued work or an errno if it
did not for some reason.
If con_work() finds the BACKOFF flag set for a connection, it now
calls queue_con_delay() to handle arranging to start again after a
delay.
Note about connection reference counts: con_work() only ever gets
called as a work item function. At the time that work is scheduled,
a reference to the connection is acquired, and the corresponding
con_work() call is then responsible for dropping that reference
before it returns.
Previously, the backoff handling inside con_work() silently handed
off its reference to delayed work it scheduled. Now that
queue_con_delay() is used, a new reference is acquired for the
newly-scheduled work, and the original reference is dropped by the
con->ops->put() call at the end of the function.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/atm/atm_sysfs.c')
0 files changed, 0 insertions, 0 deletions