aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
Diffstat (limited to 'net/core')
-rw-r--r--net/core/net_namespace.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index a044e2d9a8f0..e9f0964ce70b 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -17,8 +17,6 @@ static DEFINE_MUTEX(net_mutex);
17 17
18LIST_HEAD(net_namespace_list); 18LIST_HEAD(net_namespace_list);
19 19
20static struct kmem_cache *net_cachep;
21
22struct net init_net; 20struct net init_net;
23EXPORT_SYMBOL_GPL(init_net); 21EXPORT_SYMBOL_GPL(init_net);
24 22
@@ -59,6 +57,8 @@ out_undo:
59} 57}
60 58
61#ifdef CONFIG_NET_NS 59#ifdef CONFIG_NET_NS
60static struct kmem_cache *net_cachep;
61
62static struct net *net_alloc(void) 62static struct net *net_alloc(void)
63{ 63{
64 return kmem_cache_zalloc(net_cachep, GFP_KERNEL); 64 return kmem_cache_zalloc(net_cachep, GFP_KERNEL);
@@ -167,9 +167,11 @@ static int __init net_ns_init(void)
167 int err; 167 int err;
168 168
169 printk(KERN_INFO "net_namespace: %zd bytes\n", sizeof(struct net)); 169 printk(KERN_INFO "net_namespace: %zd bytes\n", sizeof(struct net));
170#ifdef CONFIG_NET_NS
170 net_cachep = kmem_cache_create("net_namespace", sizeof(struct net), 171 net_cachep = kmem_cache_create("net_namespace", sizeof(struct net),
171 SMP_CACHE_BYTES, 172 SMP_CACHE_BYTES,
172 SLAB_PANIC, NULL); 173 SLAB_PANIC, NULL);
174#endif
173 mutex_lock(&net_mutex); 175 mutex_lock(&net_mutex);
174 err = setup_net(&init_net); 176 err = setup_net(&init_net);
175 177