diff --git a/include/net/sock.h b/include/net/sock.h index 0ed65e3a0bea..bb972d254dff 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1103,12 +1103,6 @@ sk_sockets_allocated_read_positive(struct sock *sk) return percpu_counter_sum_positive(prot->sockets_allocated); } -static inline void sk_update_clone(const struct sock *sk, struct sock *newsk) -{ - if (mem_cgroup_sockets_enabled && sk->sk_cgrp) - sock_update_memcg(newsk); -} - static inline int proto_sockets_allocated_sum_positive(struct proto *prot) { diff --git a/net/core/sock.c b/net/core/sock.c index e80b64fbd663..c3ae73de0239 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1272,6 +1272,12 @@ void sk_release_kernel(struct sock *sk) } EXPORT_SYMBOL(sk_release_kernel); +static void sk_update_clone(const struct sock *sk, struct sock *newsk) +{ + if (mem_cgroup_sockets_enabled && sk->sk_cgrp) + sock_update_memcg(newsk); +} + /** * sk_clone_lock - clone a socket, and lock its clone * @sk: the socket to clone