rxrpc: Provide more refcount helper functions

Provide refcount helper functions for connections so that the code doesn't
touch local or connection usage counts directly.

Also make it such that local and peer put functions can take a NULL
pointer.

Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
David Howells 2016-04-04 14:00:38 +01:00
parent 985a5c824a
commit 5627cc8b96
8 changed files with 26 additions and 18 deletions

View file

@ -209,7 +209,7 @@ struct rxrpc_local *rxrpc_lookup_local(const struct sockaddr_rxrpc *srx)
* bind the transport socket may still fail if we're attempting
* to use a local address that the dying object is still using.
*/
if (!atomic_inc_not_zero(&local->usage)) {
if (!rxrpc_get_local_maybe(local)) {
cursor = cursor->next;
list_del_init(&local->link);
break;