Commit a882dfe0 authored by Tonghao Zhang's avatar Tonghao Zhang Committed by Kleber Sacilotto de Souza

sctp: Replace use of sockets_allocated with specified macro.

BugLink: http://bugs.launchpad.net/bugs/1745069

[ Upstream commit 8cb38a60 ]

The patch(180d8cd9) replaces all uses of struct sock fields'
memory_pressure, memory_allocated, sockets_allocated, and sysctl_mem
to accessor macros. But the sockets_allocated field of sctp sock is
not replaced at all. Then replace it now for unifying the code.

Fixes: 180d8cd9 ("foundations of per-cgroup memory pressure controlling.")
Cc: Glauber Costa <glommer@parallels.com>
Signed-off-by: default avatarTonghao Zhang <zhangtonghao@didichuxing.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent 6dc5c49f
...@@ -4153,7 +4153,7 @@ static int sctp_init_sock(struct sock *sk) ...@@ -4153,7 +4153,7 @@ static int sctp_init_sock(struct sock *sk)
SCTP_DBG_OBJCNT_INC(sock); SCTP_DBG_OBJCNT_INC(sock);
local_bh_disable(); local_bh_disable();
percpu_counter_inc(&sctp_sockets_allocated); sk_sockets_allocated_inc(sk);
sock_prot_inuse_add(net, sk->sk_prot, 1); sock_prot_inuse_add(net, sk->sk_prot, 1);
/* Nothing can fail after this block, otherwise /* Nothing can fail after this block, otherwise
...@@ -4197,7 +4197,7 @@ static void sctp_destroy_sock(struct sock *sk) ...@@ -4197,7 +4197,7 @@ static void sctp_destroy_sock(struct sock *sk)
} }
sctp_endpoint_free(sp->ep); sctp_endpoint_free(sp->ep);
local_bh_disable(); local_bh_disable();
percpu_counter_dec(&sctp_sockets_allocated); sk_sockets_allocated_dec(sk);
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
local_bh_enable(); local_bh_enable();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment