mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
rxrpc: Simplify connect() implementation and simplify sendmsg() op
Simplify the RxRPC connect() implementation. It will just note the destination address it is given, and if a sendmsg() comes along with no address, this will be assigned as the address. No transport struct will be held internally, which will allow us to remove this later. Simplify sendmsg() also. Whilst a call is active, userspace refers to it by a private unique user ID specified in a control message. When sendmsg() sees a user ID that doesn't map to an extant call, it creates a new call for that user ID and attempts to add it. If, when we try to add it, the user ID is now registered, we now reject the message with -EEXIST. We should never see this situation unless two threads are racing, trying to create a call with the same ID - which would be an error. It also isn't required to provide sendmsg() with an address - provided the control message data holds a user ID that maps to a currently active call. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
21aff3b905
commit
2341e07757
6 changed files with 235 additions and 345 deletions
|
@ -40,16 +40,18 @@ struct sockaddr_rxrpc {
|
|||
|
||||
/*
|
||||
* RxRPC control messages
|
||||
* - If neither abort or accept are specified, the message is a data message.
|
||||
* - terminal messages mean that a user call ID tag can be recycled
|
||||
* - s/r/- indicate whether these are applicable to sendmsg() and/or recvmsg()
|
||||
*/
|
||||
#define RXRPC_USER_CALL_ID 1 /* user call ID specifier */
|
||||
#define RXRPC_ABORT 2 /* abort request / notification [terminal] */
|
||||
#define RXRPC_ACK 3 /* [Server] RPC op final ACK received [terminal] */
|
||||
#define RXRPC_NET_ERROR 5 /* network error received [terminal] */
|
||||
#define RXRPC_BUSY 6 /* server busy received [terminal] */
|
||||
#define RXRPC_LOCAL_ERROR 7 /* local error generated [terminal] */
|
||||
#define RXRPC_NEW_CALL 8 /* [Server] new incoming call notification */
|
||||
#define RXRPC_ACCEPT 9 /* [Server] accept request */
|
||||
#define RXRPC_USER_CALL_ID 1 /* sr: user call ID specifier */
|
||||
#define RXRPC_ABORT 2 /* sr: abort request / notification [terminal] */
|
||||
#define RXRPC_ACK 3 /* -r: [Service] RPC op final ACK received [terminal] */
|
||||
#define RXRPC_NET_ERROR 5 /* -r: network error received [terminal] */
|
||||
#define RXRPC_BUSY 6 /* -r: server busy received [terminal] */
|
||||
#define RXRPC_LOCAL_ERROR 7 /* -r: local error generated [terminal] */
|
||||
#define RXRPC_NEW_CALL 8 /* -r: [Service] new incoming call notification */
|
||||
#define RXRPC_ACCEPT 9 /* s-: [Service] accept request */
|
||||
|
||||
/*
|
||||
* RxRPC security levels
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue