sock: only define socket limit if mem cgroup configured
authorstephen hemminger <stephen@networkplumber.org>
Fri, 22 Feb 2013 07:59:10 +0000 (07:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Feb 2013 20:10:19 +0000 (15:10 -0500)
The mem cgroup socket limit is only used if the config option is
enabled. Found with sparse

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c

index fe96c5d34299c1869656491e3e3609b7ff84420c..b261a79777462624d77639bd9aad398b6de6e961 100644 (file)
@@ -186,8 +186,10 @@ void mem_cgroup_sockets_destroy(struct mem_cgroup *memcg)
 static struct lock_class_key af_family_keys[AF_MAX];
 static struct lock_class_key af_family_slock_keys[AF_MAX];
 
+#if defined(CONFIG_MEMCG_KMEM)
 struct static_key memcg_socket_limit_enabled;
 EXPORT_SYMBOL(memcg_socket_limit_enabled);
+#endif
 
 /*
  * Make lock validator output more readable. (we pre-construct these