[IPV4]: fib_rules_unregister is essentially void.
[linux-2.6-block.git] / net / core / net_namespace.c
index 383252b50411b89c5c18835bcbe4c9837ed16ad0..26e941d912e8e68dd1e308e705fec2bbd92d37fc 100644 (file)
@@ -18,7 +18,7 @@ static DEFINE_MUTEX(net_mutex);
 LIST_HEAD(net_namespace_list);
 
 struct net init_net;
-EXPORT_SYMBOL_GPL(init_net);
+EXPORT_SYMBOL(init_net);
 
 /*
  * setup_net runs the initializers for the network namespace object.
@@ -58,6 +58,7 @@ out_undo:
 
 #ifdef CONFIG_NET_NS
 static struct kmem_cache *net_cachep;
+static struct workqueue_struct *netns_wq;
 
 static struct net *net_alloc(void)
 {
@@ -149,7 +150,7 @@ void __put_net(struct net *net)
 {
        /* Cleanup the network namespace in process context */
        INIT_WORK(&net->work, cleanup_net);
-       schedule_work(&net->work);
+       queue_work(netns_wq, &net->work);
 }
 EXPORT_SYMBOL_GPL(__put_net);
 
@@ -171,7 +172,13 @@ static int __init net_ns_init(void)
        net_cachep = kmem_cache_create("net_namespace", sizeof(struct net),
                                        SMP_CACHE_BYTES,
                                        SLAB_PANIC, NULL);
+
+       /* Create workqueue for cleanup */
+       netns_wq = create_singlethread_workqueue("netns");
+       if (!netns_wq)
+               panic("Could not create netns workq");
 #endif
+
        mutex_lock(&net_mutex);
        err = setup_net(&init_net);