diff options
author | NeilBrown <neilb@suse.com> | 2018-02-13 08:22:36 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-02-16 15:19:10 +0100 |
commit | 98b092804497c53ed694257dacd08f0ecc133bc9 (patch) | |
tree | 7057903d90e4c87aeabc1ef571889a716e03e3d5 /drivers/staging/lustre/lustre/mdc/mdc_request.c | |
parent | 672b63e55bdee71150e3cc472f6294e0535a95ad (diff) | |
download | op-kernel-dev-98b092804497c53ed694257dacd08f0ecc133bc9.zip op-kernel-dev-98b092804497c53ed694257dacd08f0ecc133bc9.tar.gz |
staging: lustre: use wait_event_idle_timeout() where appropriate.
When the lwi arg has a timeout, but no timeout
callback function, l_wait_event() acts much the same as
wait_event_idle_timeout() - the wait is not interruptible and
simply waits for the event or the timeouts.
The most noticable difference is that the return value is
-ETIMEDOUT or 0, rather than 0 or non-zero.
Another difference is that if the timeout is zero, l_wait_event()
will not time out at all. In the one case where that is possible
we need to conditionally use wait_event_idle().
So replace all such calls with wait_event_idle_timeout(), being
careful of the return value.
In one case, there is no event expected, only the timeout
is needed. So use schedule_timeout_uninterruptible().
Note that the presence or absence of LWI_ON_SIGNAL_NOOP
has no effect in these cases. It only has effect if the timeout
callback is non-NULL, or the timeout is zero, or
LWI_TIMEOUT_INTR_ALL() is used.
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/mdc/mdc_request.c')
-rw-r--r-- | drivers/staging/lustre/lustre/mdc/mdc_request.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index b12518b..ab48746 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -838,7 +838,6 @@ static int mdc_getpage(struct obd_export *exp, const struct lu_fid *fid, struct ptlrpc_bulk_desc *desc; struct ptlrpc_request *req; wait_queue_head_t waitq; - struct l_wait_info lwi; int resends = 0; int rc; int i; @@ -888,9 +887,7 @@ restart_bulk: exp->exp_obd->obd_name, -EIO); return -EIO; } - lwi = LWI_TIMEOUT_INTR(resends * HZ, NULL, NULL, - NULL); - l_wait_event(waitq, 0, &lwi); + wait_event_idle_timeout(waitq, 0, resends * HZ); goto restart_bulk; } |