net/smc: make smc_hash_sk/smc_unhash_sk static
authorZhengchao Shao <shaozhengchao@huawei.com>
Tue, 26 Mar 2024 07:29:52 +0000 (15:29 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Mar 2024 09:48:23 +0000 (09:48 +0000)
smc_hash_sk and smc_unhash_sk are only used in af_smc.c, so make them
static and remove the output symbol. They can be called under the path
.prot->hash()/unhash().

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: Wen Gu <guwen@linux.alibaba.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/smc.h
net/smc/af_smc.c

index c9dcb30e3fd981aab37580f38242c0223c231f0c..10684d0a33df3b9a329bfa23cd7e4f9617d5ce27 100644 (file)
@@ -26,9 +26,6 @@ struct smc_hashinfo {
        struct hlist_head ht;
 };
 
-int smc_hash_sk(struct sock *sk);
-void smc_unhash_sk(struct sock *sk);
-
 /* SMCD/ISM device driver interface */
 struct smcd_dmb {
        u64 dmb_tok;
index 4b52b3b159c0ec618506988810d56aa71278da9d..e8dcd28a554cee533a7ef690ac3262eb29a730dd 100644 (file)
@@ -177,7 +177,7 @@ static struct smc_hashinfo smc_v6_hashinfo = {
        .lock = __RW_LOCK_UNLOCKED(smc_v6_hashinfo.lock),
 };
 
-int smc_hash_sk(struct sock *sk)
+static int smc_hash_sk(struct sock *sk)
 {
        struct smc_hashinfo *h = sk->sk_prot->h.smc_hash;
        struct hlist_head *head;
@@ -191,9 +191,8 @@ int smc_hash_sk(struct sock *sk)
 
        return 0;
 }
-EXPORT_SYMBOL_GPL(smc_hash_sk);
 
-void smc_unhash_sk(struct sock *sk)
+static void smc_unhash_sk(struct sock *sk)
 {
        struct smc_hashinfo *h = sk->sk_prot->h.smc_hash;
 
@@ -202,7 +201,6 @@ void smc_unhash_sk(struct sock *sk)
                sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
        write_unlock_bh(&h->lock);
 }
-EXPORT_SYMBOL_GPL(smc_unhash_sk);
 
 /* This will be called before user really release sock_lock. So do the
  * work which we didn't do because of user hold the sock_lock in the