aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-11-15 09:11:48 -0800
committerDavid S. Miller <davem@davemloft.net>2021-11-16 13:20:45 +0000
commitd477eb9004845cb2dc92ad5eed79a437738a868a (patch)
tree674063d4742100736af21b37e179736d2251bb0b /include/net/sock.h
parentnet: inline sock_prot_inuse_add() (diff)
downloadlinux-dev-d477eb9004845cb2dc92ad5eed79a437738a868a.tar.xz
linux-dev-d477eb9004845cb2dc92ad5eed79a437738a868a.zip
net: make sock_inuse_add() available
MPTCP hard codes it, let us instead provide this helper. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 5a1e1df3cefd..c4c981a51797 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1439,6 +1439,12 @@ 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.sock_inuse, val);
+}
+
int sock_prot_inuse_get(struct net *net, struct proto *proto);
int sock_inuse_get(struct net *net);
#else
@@ -1446,6 +1452,10 @@ 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