aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-02-13 10:47:59 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-16 15:19:11 +0100
commit9fc53ff230aae24136ce7740606cca1f59432ebe (patch)
tree75b88a68cedbdb4378c882666a539626c77da864 /drivers/staging/lustre
parentstaging: lustre: use explicit poll loop in ptlrpc_service_unlink_rqbd (diff)
downloadlinux-dev-9fc53ff230aae24136ce7740606cca1f59432ebe.tar.xz
linux-dev-9fc53ff230aae24136ce7740606cca1f59432ebe.zip
staging: lustre: use explicit poll loop in ptlrpc_unregister_reply
replace l_wait_event() with wait_event_idle_timeout() and explicit loop. This approach is easier to understand. 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')
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/client.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c
index f70176c6db08..ffdd3ffd62c6 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -2500,7 +2500,6 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
{
int rc;
wait_queue_head_t *wq;
- struct l_wait_info lwi;
/* Might sleep. */
LASSERT(!in_interrupt());
@@ -2543,16 +2542,17 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
* Network access will complete in finite time but the HUGE
* timeout lets us CWARN for visibility of sluggish NALs
*/
- lwi = LWI_TIMEOUT_INTERVAL(LONG_UNLINK * HZ,
- HZ, NULL, NULL);
- rc = l_wait_event(*wq, !ptlrpc_client_recv_or_unlink(request),
- &lwi);
- if (rc == 0) {
+ int cnt = 0;
+ while (cnt < LONG_UNLINK &&
+ (rc = wait_event_idle_timeout(*wq,
+ !ptlrpc_client_recv_or_unlink(request),
+ HZ)) == 0)
+ cnt += 1;
+ if (rc > 0) {
ptlrpc_rqphase_move(request, request->rq_next_phase);
return 1;
}
- LASSERT(rc == -ETIMEDOUT);
DEBUG_REQ(D_WARNING, request,
"Unexpectedly long timeout receiving_reply=%d req_ulinked=%d reply_unlinked=%d",
request->rq_receiving_reply,