Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/smc: make smc_hash_sk/smc_unhash_sk static

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>

authored by

Zhengchao Shao and committed by
David S. Miller
af398bd0 17593357

+2 -7
-3
include/net/smc.h
··· 26 26 struct hlist_head ht; 27 27 }; 28 28 29 - int smc_hash_sk(struct sock *sk); 30 - void smc_unhash_sk(struct sock *sk); 31 - 32 29 /* SMCD/ISM device driver interface */ 33 30 struct smcd_dmb { 34 31 u64 dmb_tok;
+2 -4
net/smc/af_smc.c
··· 177 177 .lock = __RW_LOCK_UNLOCKED(smc_v6_hashinfo.lock), 178 178 }; 179 179 180 - int smc_hash_sk(struct sock *sk) 180 + static int smc_hash_sk(struct sock *sk) 181 181 { 182 182 struct smc_hashinfo *h = sk->sk_prot->h.smc_hash; 183 183 struct hlist_head *head; ··· 191 191 192 192 return 0; 193 193 } 194 - EXPORT_SYMBOL_GPL(smc_hash_sk); 195 194 196 - void smc_unhash_sk(struct sock *sk) 195 + static void smc_unhash_sk(struct sock *sk) 197 196 { 198 197 struct smc_hashinfo *h = sk->sk_prot->h.smc_hash; 199 198 ··· 201 202 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); 202 203 write_unlock_bh(&h->lock); 203 204 } 204 - EXPORT_SYMBOL_GPL(smc_unhash_sk); 205 205 206 206 /* This will be called before user really release sock_lock. So do the 207 207 * work which we didn't do because of user hold the sock_lock in the