@@ -1433,11 +1433,6 @@ static inline void sock_prot_inuse_add(const struct net *net,
this_cpu_add(net->core.prot_inuse->val[prot->inuse_idx], val);
}
-static inline void sock_inuse_add(const struct net *net, int val)
-{
- this_cpu_add(net->core.prot_inuse->all, val);
-}
-
int sock_prot_inuse_get(struct net *net, struct proto *proto);
int sock_inuse_get(struct net *net);
#else
@@ -1445,10 +1440,6 @@ static inline void sock_prot_inuse_add(const struct net *net,
const struct proto *prot, int val)
{
}
-
-static inline void sock_inuse_add(const struct net *net, int val)
-{
-}
#endif
@@ -153,6 +153,7 @@
static DEFINE_MUTEX(proto_list_mutex);
static LIST_HEAD(proto_list);
+static void sock_inuse_add(const struct net *net, int val);
static void sock_def_write_space_wfree(struct sock *sk);
static void sock_def_write_space(struct sock *sk);
@@ -3885,6 +3886,11 @@ int sock_prot_inuse_get(struct net *net, struct proto *prot)
}
EXPORT_SYMBOL_GPL(sock_prot_inuse_get);
+static void sock_inuse_add(const struct net *net, int val)
+{
+ this_cpu_add(net->core.prot_inuse->all, val);
+}
+
int sock_inuse_get(struct net *net)
{
int cpu, res = 0;
@@ -3944,6 +3950,10 @@ static void release_proto_idx(struct proto *prot)
clear_bit(prot->inuse_idx, proto_inuse_idx);
}
#else
+static void sock_inuse_add(const struct net *net, int val)
+{
+}
+
static inline int assign_proto_idx(struct proto *prot)
{
return 0;
sock_inuse_add() is used only in net/core/sock.c. Let's move sock_inuse_add() there. This is mostly revert of commit d477eb900484 ("net: make sock_inuse_add() available"). Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> --- include/net/sock.h | 9 --------- net/core/sock.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-)