diff options
author | Tonghao Zhang <xiangxia.m.yue@gmail.com> | 2017-12-14 08:51:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-19 09:58:14 -0500 |
commit | 08fc7f8140730d2f8499c91b5abad44581b74635 (patch) | |
tree | 1721c606036933c2bb9d5c6796b307d70704e5d0 | |
parent | 962b582785b60a2b420b0636ad762959c72406f6 (diff) |
sock: Change the netns_core member name.
Change the member name will make the code more readable.
This patch will be used in next patch.
Signed-off-by: Martin Zhang <zhangjunweimartin@didichuxing.com>
Signed-off-by: Tonghao Zhang <zhangtonghao@didichuxing.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/netns/core.h | 2 | ||||
-rw-r--r-- | net/core/sock.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/net/netns/core.h b/include/net/netns/core.h index 0ad4d0c71228..45cfb5dc76c7 100644 --- a/include/net/netns/core.h +++ b/include/net/netns/core.h | |||
@@ -11,7 +11,7 @@ struct netns_core { | |||
11 | 11 | ||
12 | int sysctl_somaxconn; | 12 | int sysctl_somaxconn; |
13 | 13 | ||
14 | struct prot_inuse __percpu *inuse; | 14 | struct prot_inuse __percpu *prot_inuse; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | #endif | 17 | #endif |
diff --git a/net/core/sock.c b/net/core/sock.c index c0b5b2f17412..c2dd2d339db7 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -3045,7 +3045,7 @@ static DECLARE_BITMAP(proto_inuse_idx, PROTO_INUSE_NR); | |||
3045 | 3045 | ||
3046 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) | 3046 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) |
3047 | { | 3047 | { |
3048 | __this_cpu_add(net->core.inuse->val[prot->inuse_idx], val); | 3048 | __this_cpu_add(net->core.prot_inuse->val[prot->inuse_idx], val); |
3049 | } | 3049 | } |
3050 | EXPORT_SYMBOL_GPL(sock_prot_inuse_add); | 3050 | EXPORT_SYMBOL_GPL(sock_prot_inuse_add); |
3051 | 3051 | ||
@@ -3055,7 +3055,7 @@ int sock_prot_inuse_get(struct net *net, struct proto *prot) | |||
3055 | int res = 0; | 3055 | int res = 0; |
3056 | 3056 | ||
3057 | for_each_possible_cpu(cpu) | 3057 | for_each_possible_cpu(cpu) |
3058 | res += per_cpu_ptr(net->core.inuse, cpu)->val[idx]; | 3058 | res += per_cpu_ptr(net->core.prot_inuse, cpu)->val[idx]; |
3059 | 3059 | ||
3060 | return res >= 0 ? res : 0; | 3060 | return res >= 0 ? res : 0; |
3061 | } | 3061 | } |
@@ -3063,13 +3063,13 @@ EXPORT_SYMBOL_GPL(sock_prot_inuse_get); | |||
3063 | 3063 | ||
3064 | static int __net_init sock_inuse_init_net(struct net *net) | 3064 | static int __net_init sock_inuse_init_net(struct net *net) |
3065 | { | 3065 | { |
3066 | net->core.inuse = alloc_percpu(struct prot_inuse); | 3066 | net->core.prot_inuse = alloc_percpu(struct prot_inuse); |
3067 | return net->core.inuse ? 0 : -ENOMEM; | 3067 | return net->core.prot_inuse ? 0 : -ENOMEM; |
3068 | } | 3068 | } |
3069 | 3069 | ||
3070 | static void __net_exit sock_inuse_exit_net(struct net *net) | 3070 | static void __net_exit sock_inuse_exit_net(struct net *net) |
3071 | { | 3071 | { |
3072 | free_percpu(net->core.inuse); | 3072 | free_percpu(net->core.prot_inuse); |
3073 | } | 3073 | } |
3074 | 3074 | ||
3075 | static struct pernet_operations net_inuse_ops = { | 3075 | static struct pernet_operations net_inuse_ops = { |