sock: Hide unused variable when !CONFIG_PROC_FS.
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Thu, 14 Dec 2017 13:51:59 +0000 (05:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Dec 2017 14:58:14 +0000 (09:58 -0500)
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>
include/net/netns/core.h

index a5e8a66c57b450c05c4c27eb609b9c547c30e19f..36c2d998a43c015c4b917428ec33f5839cde89b1 100644 (file)
@@ -13,8 +13,8 @@ struct netns_core {
 
 #ifdef CONFIG_PROC_FS
        int __percpu *sock_inuse;
-#endif
        struct prot_inuse __percpu *prot_inuse;
+#endif
 };
 
 #endif