aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.h
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2014-08-22 18:09:14 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-23 11:18:34 -0700
commit5a9ee0be3371eb77d671a77e26261931c5c3fb31 (patch)
tree6127a9c68edea30b97209bc6eedee1ce5b641c17 /net/tipc/socket.h
parenttipc: eliminate functions tipc_port_init and tipc_port_destroy (diff)
downloadlinux-dev-5a9ee0be3371eb77d671a77e26261931c5c3fb31.tar.xz
linux-dev-5a9ee0be3371eb77d671a77e26261931c5c3fb31.zip
tipc: use registry when scanning sockets
The functions tipc_port_get_ports() and tipc_port_reinit() scan over all sockets/ports to access each of them. This is done by using a dedicated linked list, 'tipc_socks' where all sockets are members. The list is in turn protected by a spinlock, 'port_list_lock', while each socket is locked by using port_lock at the moment of access. In order to reduce complexity and risk of deadlock, we want to get rid of the linked list and the accompanying spinlock. This is what we do in this commit. Instead of the linked list, we use the port registry to scan across the sockets. We also add usage of bh_lock_sock() inside the scope of port_lock in both functions, as a preparation for the complete removal of port_lock. Finally, we move the functions from port.c to socket.c, and rename them to tipc_sk_sock_show() and tipc_sk_reinit() repectively. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.h')
-rw-r--r--net/tipc/socket.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/tipc/socket.h b/net/tipc/socket.h
index 1405633362f5..5d515be604a9 100644
--- a/net/tipc/socket.h
+++ b/net/tipc/socket.h
@@ -79,7 +79,8 @@ static inline int tipc_sk_conn_cong(struct tipc_sock *tsk)
}
int tipc_sk_rcv(struct sk_buff *buf);
-
+struct sk_buff *tipc_sk_socks_show(void);
void tipc_sk_mcast_rcv(struct sk_buff *buf);
+void tipc_sk_reinit(void);
#endif