Skip to content

Commit

Permalink
skmsg: Make sk_psock_destroy() static
Browse files Browse the repository at this point in the history
[ Upstream commit 8063e18 ]

sk_psock_destroy() is a RCU callback, I can't see any reason why
it could be used outside.

Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Cc: Lorenz Bauer <lmb@cloudflare.com>
Link: https://lore.kernel.org/bpf/20210127221501.46866-1-xiyou.wangcong@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Cong Wang authored and gregkh committed Aug 4, 2021
1 parent 645a1d3 commit 1b148bd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion include/linux/skmsg.h
Expand Up @@ -395,7 +395,6 @@ static inline struct sk_psock *sk_psock_get(struct sock *sk)
}

void sk_psock_stop(struct sock *sk, struct sk_psock *psock);
void sk_psock_destroy(struct rcu_head *rcu);
void sk_psock_drop(struct sock *sk, struct sk_psock *psock);

static inline void sk_psock_put(struct sock *sk, struct sk_psock *psock)
Expand Down
3 changes: 1 addition & 2 deletions net/core/skmsg.c
Expand Up @@ -676,14 +676,13 @@ static void sk_psock_destroy_deferred(struct work_struct *gc)
kfree(psock);
}

void sk_psock_destroy(struct rcu_head *rcu)
static void sk_psock_destroy(struct rcu_head *rcu)
{
struct sk_psock *psock = container_of(rcu, struct sk_psock, rcu);

INIT_WORK(&psock->gc, sk_psock_destroy_deferred);
schedule_work(&psock->gc);
}
EXPORT_SYMBOL_GPL(sk_psock_destroy);

void sk_psock_drop(struct sock *sk, struct sk_psock *psock)
{
Expand Down

0 comments on commit 1b148bd

Please sign in to comment.