diff options
author | NeilBrown <neilb@suse.com> | 2018-02-13 10:47:59 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-02-16 15:19:11 +0100 |
commit | c7621ba215b11ca8976d38093768b8630df3d0d6 (patch) | |
tree | b3fe19ce31bfc9c6f333d663d5e3c8a64f71a2a1 /drivers/staging/lustre/lustre/ptlrpc/client.c | |
parent | staging: lustre: make polling loop in ptlrpc_unregister_bulk more obvious (diff) | |
download | linux-dev-c7621ba215b11ca8976d38093768b8630df3d0d6.tar.xz linux-dev-c7621ba215b11ca8976d38093768b8630df3d0d6.zip |
staging: lustre: use wait_event_idle_timeout in ptlrpcd()
We can replace l_wait_event() with
wait_event_idle_timeout() here providing we call the
timeout function when wait_event_idle_timeout() returns zero.
As ptlrpc_expired_set() returns 1, the l_wait_event() aborts of the
first timeout.
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/ptlrpc/client.c')
-rw-r--r-- | drivers/staging/lustre/lustre/ptlrpc/client.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index 81b7a7046d82..f70176c6db08 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -2125,9 +2125,8 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req, int async_unlink) * Callback used when waiting on sets with l_wait_event. * Always returns 1. */ -int ptlrpc_expired_set(void *data) +void ptlrpc_expired_set(struct ptlrpc_request_set *set) { - struct ptlrpc_request_set *set = data; struct list_head *tmp; time64_t now = ktime_get_real_seconds(); @@ -2156,7 +2155,12 @@ int ptlrpc_expired_set(void *data) */ ptlrpc_expire_one_request(req, 1); } +} +static int ptlrpc_expired_set_void(void *data) +{ + struct ptlrpc_request_set *set = data; + ptlrpc_expired_set(set); /* * When waiting for a whole set, we always break out of the * sleep so we can recalculate the timeout, or enable interrupts @@ -2286,7 +2290,7 @@ int ptlrpc_set_wait(struct ptlrpc_request_set *set) * so we allow interrupts during the timeout. */ lwi = LWI_TIMEOUT_INTR_ALL(HZ, - ptlrpc_expired_set, + ptlrpc_expired_set_void, ptlrpc_interrupted_set, set); else /* @@ -2295,7 +2299,7 @@ int ptlrpc_set_wait(struct ptlrpc_request_set *set) * complete, or an in-flight req times out. */ lwi = LWI_TIMEOUT((timeout ? timeout : 1) * HZ, - ptlrpc_expired_set, set); + ptlrpc_expired_set_void, set); rc = l_wait_event(set->set_waitq, ptlrpc_check_set(NULL, set), &lwi); |