summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTonghao Zhang <xiangxia.m.yue@gmail.com>2017-12-22 10:15:20 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-02 20:04:59 +0100
commit986444eaddc5919c37319efaa86271539989ef36 (patch)
treeb91b7e3a6c92a1710f5e9e0155d83b0c9dda006b /net
parenta11d92b0779db90c0b0b1617bda3f81aad2438b3 (diff)
downloadlinux-stable-986444eaddc5919c37319efaa86271539989ef36.tar.gz
linux-stable-986444eaddc5919c37319efaa86271539989ef36.tar.bz2
linux-stable-986444eaddc5919c37319efaa86271539989ef36.zip
sctp: Replace use of sockets_allocated with specified macro.
[ Upstream commit 8cb38a602478e9f806571f6920b0a3298aabf042 ] The patch(180d8cd942ce) 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: 180d8cd942ce ("foundations of per-cgroup memory pressure controlling.") Cc: Glauber Costa <glommer@parallels.com> Signed-off-by: Tonghao Zhang <zhangtonghao@didichuxing.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/sctp/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 8e019692bb42..4477a5443f65 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4166,7 +4166,7 @@ static int sctp_init_sock(struct sock *sk)
SCTP_DBG_OBJCNT_INC(sock);
local_bh_disable();
- percpu_counter_inc(&sctp_sockets_allocated);
+ sk_sockets_allocated_inc(sk);
sock_prot_inuse_add(net, sk->sk_prot, 1);
/* Nothing can fail after this block, otherwise
@@ -4210,7 +4210,7 @@ static void sctp_destroy_sock(struct sock *sk)
}
sctp_endpoint_free(sp->ep);
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);
local_bh_enable();
}