rxrpc: Make rxrpc_kernel_check_life() indicate if call completed

Make rxrpc_kernel_check_life() pass back the life counter through the
argument list and return true if the call has not yet completed.

Suggested-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Marc Dionne
2019-04-12 16:33:47 +01:00
committed by David S. Miller
parent 56d282d9db
commit 4611da30d6
4 changed files with 23 additions and 15 deletions

View File

@@ -371,18 +371,22 @@ EXPORT_SYMBOL(rxrpc_kernel_end_call);
* rxrpc_kernel_check_life - Check to see whether a call is still alive
* @sock: The socket the call is on
* @call: The call to check
* @_life: Where to store the life value
*
* Allow a kernel service to find out whether a call is still alive - ie. we're
* getting ACKs from the server. Returns a number representing the life state
* which can be compared to that returned by a previous call.
* getting ACKs from the server. Passes back in *_life a number representing
* the life state which can be compared to that returned by a previous call and
* return true if the call is still alive.
*
* If the life state stalls, rxrpc_kernel_probe_life() should be called and
* then 2RTT waited.
*/
u32 rxrpc_kernel_check_life(const struct socket *sock,
const struct rxrpc_call *call)
bool rxrpc_kernel_check_life(const struct socket *sock,
const struct rxrpc_call *call,
u32 *_life)
{
return call->acks_latest;
*_life = call->acks_latest;
return call->state != RXRPC_CALL_COMPLETE;
}
EXPORT_SYMBOL(rxrpc_kernel_check_life);