summaryrefslogtreecommitdiff
path: root/net/tipc/topsrv.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-05-28 08:12:36 +0300
committerDavid S. Miller <davem@davemloft.net>2020-05-28 21:11:46 +0300
commit095ae612530c9465df6d372d688cb30c6abfc5f5 (patch)
tree79271cfd7014dfd17cdb32495757374c7e1c18c4 /net/tipc/topsrv.c
parent298cd88a66a02c899772ffafbf648786ceb5ab95 (diff)
downloadlinux-095ae612530c9465df6d372d688cb30c6abfc5f5.tar.xz
tipc: call tsk_set_importance from tipc_topsrv_create_listener
Avoid using kernel_setsockopt for the TIPC_IMPORTANCE option when we can just use the internal helper. The only change needed is to pass a struct sock instead of tipc_sock, which is private to socket.c Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/topsrv.c')
-rw-r--r--net/tipc/topsrv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c
index 446af7bbd13e..1489cfb941d8 100644
--- a/net/tipc/topsrv.c
+++ b/net/tipc/topsrv.c
@@ -497,7 +497,6 @@ static void tipc_topsrv_listener_data_ready(struct sock *sk)
static int tipc_topsrv_create_listener(struct tipc_topsrv *srv)
{
- int imp = TIPC_CRITICAL_IMPORTANCE;
struct socket *lsock = NULL;
struct sockaddr_tipc saddr;
struct sock *sk;
@@ -514,8 +513,9 @@ static int tipc_topsrv_create_listener(struct tipc_topsrv *srv)
sk->sk_user_data = srv;
write_unlock_bh(&sk->sk_callback_lock);
- rc = kernel_setsockopt(lsock, SOL_TIPC, TIPC_IMPORTANCE,
- (char *)&imp, sizeof(imp));
+ lock_sock(sk);
+ rc = tsk_set_importance(sk, TIPC_CRITICAL_IMPORTANCE);
+ release_sock(sk);
if (rc < 0)
goto err;