Whamcloud - gitweb
LU-10467 ptlrpc: convert waiting in sptlrpc_req_refresh_ctx() 87/35987/10
authorMr NeilBrown <neilb@suse.com>
Mon, 30 Dec 2019 15:01:24 +0000 (10:01 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 10 Jan 2020 07:40:35 +0000 (07:40 +0000)
commitc1fad6a9a583b395c23ea1a102f1b67c50640f6f
tree561f20663a9ef7864d83b644225a68b81178bfa4
parenta7ff5d050ee7db0e80baac5fb3848ffcfa04dea6
LU-10467 ptlrpc: convert waiting in sptlrpc_req_refresh_ctx()

The l_wait_event call in sptlrpc_req_refresh_ctx() is somewhat complex
as it is passed both an on_timeout and on_signal handler, and
on_timeout doesn't return a constant value.

The net effect is to wait for the timeout with signals blocked.  Then,
if the condition still isn't true, run the on_timeout handler and if
that returns zero, wait again - indefinitely this time - and allow
some signals.  If a signal was received, call the on_signal handler.

This is fairly straight forward to write out in C, as shown in the
patch.

Change-Id: I7f9cfb8a8ff234bed4045ab21b53d018337cd615
Signed-off-by: Mr NeilBrown <neilb@suse.com>
Reviewed-on: https://review.whamcloud.com/35987
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/sec.c