Skip to content

Commit af398bd

Browse files
zhengchaoshaodavem330
authored andcommitted
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>
1 parent 1759335 commit af398bd

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

include/net/smc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ struct smc_hashinfo {
2626
struct hlist_head ht;
2727
};
2828

29-
int smc_hash_sk(struct sock *sk);
30-
void smc_unhash_sk(struct sock *sk);
31-
3229
/* SMCD/ISM device driver interface */
3330
struct smcd_dmb {
3431
u64 dmb_tok;

net/smc/af_smc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static struct smc_hashinfo smc_v6_hashinfo = {
177177
.lock = __RW_LOCK_UNLOCKED(smc_v6_hashinfo.lock),
178178
};
179179

180-
int smc_hash_sk(struct sock *sk)
180+
static int smc_hash_sk(struct sock *sk)
181181
{
182182
struct smc_hashinfo *h = sk->sk_prot->h.smc_hash;
183183
struct hlist_head *head;
@@ -191,9 +191,8 @@ int smc_hash_sk(struct sock *sk)
191191

192192
return 0;
193193
}
194-
EXPORT_SYMBOL_GPL(smc_hash_sk);
195194

196-
void smc_unhash_sk(struct sock *sk)
195+
static void smc_unhash_sk(struct sock *sk)
197196
{
198197
struct smc_hashinfo *h = sk->sk_prot->h.smc_hash;
199198

@@ -202,7 +201,6 @@ void smc_unhash_sk(struct sock *sk)
202201
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
203202
write_unlock_bh(&h->lock);
204203
}
205-
EXPORT_SYMBOL_GPL(smc_unhash_sk);
206204

207205
/* This will be called before user really release sock_lock. So do the
208206
* work which we didn't do because of user hold the sock_lock in the

0 commit comments

Comments
 (0)