summaryrefslogtreecommitdiff
path: root/net/rxrpc/af_rxrpc.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-09-08 13:10:11 +0300
committerDavid Howells <dhowells@redhat.com>2016-09-08 13:10:11 +0300
commitde8d6c7401ae8f25db3788804c86887ad7347bee (patch)
tree350b339d5c533cddb0610a77dec521bb422c2bd4 /net/rxrpc/af_rxrpc.c
parent18f1387c7d7c6827b3ed6adf6ae20f65a58dc7b0 (diff)
downloadlinux-de8d6c7401ae8f25db3788804c86887ad7347bee.tar.xz
rxrpc: Convert rxrpc_local::services to an hlist
Convert the rxrpc_local::services list to an hlist so that it can be accessed under RCU conditions more readily. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc/af_rxrpc.c')
-rw-r--r--net/rxrpc/af_rxrpc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
index 77a132abf140..f13cca1e973e 100644
--- a/net/rxrpc/af_rxrpc.c
+++ b/net/rxrpc/af_rxrpc.c
@@ -156,13 +156,13 @@ static int rxrpc_bind(struct socket *sock, struct sockaddr *saddr, int len)
if (rx->srx.srx_service) {
write_lock_bh(&local->services_lock);
- list_for_each_entry(prx, &local->services, listen_link) {
+ hlist_for_each_entry(prx, &local->services, listen_link) {
if (prx->srx.srx_service == rx->srx.srx_service)
goto service_in_use;
}
rx->local = local;
- list_add_tail(&rx->listen_link, &local->services);
+ hlist_add_head_rcu(&rx->listen_link, &local->services);
write_unlock_bh(&local->services_lock);
rx->sk.sk_state = RXRPC_SERVER_BOUND;
@@ -567,7 +567,7 @@ static int rxrpc_create(struct net *net, struct socket *sock, int protocol,
rx->family = protocol;
rx->calls = RB_ROOT;
- INIT_LIST_HEAD(&rx->listen_link);
+ INIT_HLIST_NODE(&rx->listen_link);
INIT_LIST_HEAD(&rx->secureq);
INIT_LIST_HEAD(&rx->acceptq);
rwlock_init(&rx->call_lock);
@@ -615,9 +615,9 @@ static int rxrpc_release_sock(struct sock *sk)
ASSERTCMP(rx->listen_link.next, !=, LIST_POISON1);
- if (!list_empty(&rx->listen_link)) {
+ if (!hlist_unhashed(&rx->listen_link)) {
write_lock_bh(&rx->local->services_lock);
- list_del(&rx->listen_link);
+ hlist_del_rcu(&rx->listen_link);
write_unlock_bh(&rx->local->services_lock);
}