]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: Simplify connect() implementation and simplify sendmsg() op
authorDavid Howells <dhowells@redhat.com>
Thu, 9 Jun 2016 22:02:51 +0000 (23:02 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Jun 2016 06:30:12 +0000 (23:30 -0700)
commit1e7c822ca17585fe768404835d640608f226f594
tree7fd06d4a7946097c545af86a53bae9fed3e59744
parentbca9cca037368f3616ea95738286e2f0758aa29c
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>
include/linux/rxrpc.h
net/rxrpc/af_rxrpc.c
net/rxrpc/ar-call.c
net/rxrpc/ar-connection.c
net/rxrpc/ar-internal.h
net/rxrpc/ar-output.c