[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1510760215-2403-1-git-send-email-zhangtonghao@didichuxing.com>
Date: Wed, 15 Nov 2017 07:36:54 -0800
From: Tonghao Zhang <xiangxia.m.yue@...il.com>
To: netdev@...r.kernel.org
Cc: xiyou.wangcong@...il.com, Tonghao Zhang <xiangxia.m.yue@...il.com>,
Martin Zhang <zhangjunweimartin@...ichuxing.com>,
Tonghao Zhang <zhangtonghao@...ichuxing.com>
Subject: [PATCH v3 1/2] sock: Change the netns_core member name.
From: Tonghao Zhang <xiangxia.m.yue@...il.com>
Change the member name will make the code more readable.
This patch will be used in next patch.
Signed-off-by: Martin Zhang <zhangjunweimartin@...ichuxing.com>
Signed-off-by: Tonghao Zhang <zhangtonghao@...ichuxing.com>
---
include/net/netns/core.h | 2 +-
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 78eb1ff75475..6490b79881d2 100644
--- a/include/net/netns/core.h
+++ b/include/net/netns/core.h
@@ -10,7 +10,7 @@ struct netns_core {
int sysctl_somaxconn;
- struct prot_inuse __percpu *inuse;
+ struct prot_inuse __percpu *prot_inuse;
};
#endif
diff --git a/net/core/sock.c b/net/core/sock.c
index 03e1b1ec0d5b..b899d8669388 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3044,7 +3044,7 @@ static DECLARE_BITMAP(proto_inuse_idx, PROTO_INUSE_NR);
void sock_prot_inuse_add(struct net *net, struct proto *prot, int val)
{
- __this_cpu_add(net->core.inuse->val[prot->inuse_idx], val);
+ __this_cpu_add(net->core.prot_inuse->val[prot->inuse_idx], val);
}
EXPORT_SYMBOL_GPL(sock_prot_inuse_add);
@@ -3054,7 +3054,7 @@ int sock_prot_inuse_get(struct net *net, struct proto *prot)
int res = 0;
for_each_possible_cpu(cpu)
- res += per_cpu_ptr(net->core.inuse, cpu)->val[idx];
+ res += per_cpu_ptr(net->core.prot_inuse, cpu)->val[idx];
return res >= 0 ? res : 0;
}
@@ -3062,13 +3062,13 @@ EXPORT_SYMBOL_GPL(sock_prot_inuse_get);
static int __net_init sock_inuse_init_net(struct net *net)
{
- net->core.inuse = alloc_percpu(struct prot_inuse);
- return net->core.inuse ? 0 : -ENOMEM;
+ net->core.prot_inuse = alloc_percpu(struct prot_inuse);
+ return net->core.prot_inuse ? 0 : -ENOMEM;
}
static void __net_exit sock_inuse_exit_net(struct net *net)
{
- free_percpu(net->core.inuse);
+ free_percpu(net->core.prot_inuse);
}
static struct pernet_operations net_inuse_ops = {
--
2.13.6
Powered by blists - more mailing lists