Skip to content

Commit

Permalink
sock: Hide unused variable when !CONFIG_PROC_FS.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tonghao Zhang authored and David S. Miller committed Dec 19, 2017
1 parent 648845a commit 398b841
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/netns/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ struct netns_core {

#ifdef CONFIG_PROC_FS
int __percpu *sock_inuse;
#endif
struct prot_inuse __percpu *prot_inuse;
#endif
};

#endif

0 comments on commit 398b841

Please sign in to comment.