mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
rxrpc: Calls should only have one terminal state
Condense the terminal states of a call state machine to a single state, plus a separate completion type value. The value is then set, along with error and abort code values, only when the call is transitioned to the completion state. Helpers are provided to simplify this. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
@@ -294,12 +294,17 @@ receive_non_data_message:
|
||||
ret = put_cmsg(msg, SOL_RXRPC, RXRPC_BUSY, 0, &abort_code);
|
||||
break;
|
||||
case RXRPC_SKB_MARK_REMOTE_ABORT:
|
||||
abort_code = call->remote_abort;
|
||||
abort_code = call->abort_code;
|
||||
ret = put_cmsg(msg, SOL_RXRPC, RXRPC_ABORT, 4, &abort_code);
|
||||
break;
|
||||
case RXRPC_SKB_MARK_LOCAL_ABORT:
|
||||
abort_code = call->local_abort;
|
||||
abort_code = call->abort_code;
|
||||
ret = put_cmsg(msg, SOL_RXRPC, RXRPC_ABORT, 4, &abort_code);
|
||||
if (call->error) {
|
||||
abort_code = call->error;
|
||||
ret = put_cmsg(msg, SOL_RXRPC, RXRPC_LOCAL_ERROR, 4,
|
||||
&abort_code);
|
||||
}
|
||||
break;
|
||||
case RXRPC_SKB_MARK_NET_ERROR:
|
||||
_debug("RECV NET ERROR %d", sp->error);
|
||||
@@ -392,9 +397,8 @@ u32 rxrpc_kernel_get_abort_code(struct sk_buff *skb)
|
||||
|
||||
switch (skb->mark) {
|
||||
case RXRPC_SKB_MARK_REMOTE_ABORT:
|
||||
return sp->call->remote_abort;
|
||||
case RXRPC_SKB_MARK_LOCAL_ABORT:
|
||||
return sp->call->local_abort;
|
||||
return sp->call->abort_code;
|
||||
default:
|
||||
BUG();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user