Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78171
b: refs/heads/master
c: 3ef1355
h: refs/heads/master
i:
  78169: 2a55620
  78167: 68838af
v: v3
  • Loading branch information
Benjamin Thery authored and David S. Miller committed Jan 28, 2008
1 parent 40d1e31 commit 3ef6e97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85b606800be20ceeca36bd8594c1eb228d2fb2f4
refs/heads/master: 3ef1355dcb8551730cc71e9ef4363f5c66ccad17
9 changes: 8 additions & 1 deletion trunk/net/core/net_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static __net_init int setup_net(struct net *net)

#ifdef CONFIG_NET_NS
static struct kmem_cache *net_cachep;
static struct workqueue_struct *netns_wq;

static struct net *net_alloc(void)
{
Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit 3ef6e97

Please sign in to comment.