Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73276
b: refs/heads/master
c: 45a19b0
h: refs/heads/master
v: v3
  • Loading branch information
Johann Felix Soden authored and David S. Miller committed Nov 7, 2007
1 parent 8f1d0c5 commit 457a70a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 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: d0127539ea9b5fcfe1a1d7d4d57f12384da5190c
refs/heads/master: 45a19b0a725a04f3255d9d3da1fca30bb97f1481
28 changes: 14 additions & 14 deletions trunk/net/core/net_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ static struct net *net_alloc(void)
return kmem_cache_zalloc(net_cachep, GFP_KERNEL);
}

static void net_free(struct net *net)
{
if (!net)
return;

if (unlikely(atomic_read(&net->use_count) != 0)) {
printk(KERN_EMERG "network namespace not free! Usage: %d\n",
atomic_read(&net->use_count));
return;
}

kmem_cache_free(net_cachep, net);
}

struct net *copy_net_ns(unsigned long flags, struct net *old_net)
{
struct net *new_net = NULL;
Expand Down Expand Up @@ -100,20 +114,6 @@ struct net *copy_net_ns(unsigned long flags, struct net *old_net)
return new_net;
}

static void net_free(struct net *net)
{
if (!net)
return;

if (unlikely(atomic_read(&net->use_count) != 0)) {
printk(KERN_EMERG "network namespace not free! Usage: %d\n",
atomic_read(&net->use_count));
return;
}

kmem_cache_free(net_cachep, net);
}

static void cleanup_net(struct work_struct *work)
{
struct pernet_operations *ops;
Expand Down

0 comments on commit 457a70a

Please sign in to comment.