summaryrefslogtreecommitdiffstats
path: root/include/net/netns
diff options
context:
space:
mode:
authorTonghao Zhang <xiangxia.m.yue@gmail.com>2017-12-14 14:51:59 +0100
committerDavid S. Miller <davem@davemloft.net>2017-12-19 15:58:14 +0100
commit398b841e4ad69a822f615442b5ea4ca767330a3b (patch)
tree011226fe28681a501706a9c8acf56e16602cd354 /include/net/netns
parentsock: Move the socket inuse to namespace. (diff)
downloadlinux-398b841e4ad69a822f615442b5ea4ca767330a3b.tar.xz
linux-398b841e4ad69a822f615442b5ea4ca767330a3b.zip
sock: Hide unused variable when !CONFIG_PROC_FS.
When CONFIG_PROC_FS is disabled, we will not use the prot_inuse counter. This adds an #ifdef to hide the variable definition in that case. This is not a bugfix. But we can save bytes when there are many network namespace. Cc: Pavel Emelyanov <xemul@openvz.org> 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>
Diffstat (limited to 'include/net/netns')
-rw-r--r--include/net/netns/core.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/netns/core.h b/include/net/netns/core.h
index a5e8a66c57b4..36c2d998a43c 100644
--- a/include/net/netns/core.h
+++ b/include/net/netns/core.h
@@ -13,8 +13,8 @@ struct netns_core {
#ifdef CONFIG_PROC_FS
int __percpu *sock_inuse;
-#endif
struct prot_inuse __percpu *prot_inuse;
+#endif
};
#endif