Skip to content

Commit

Permalink
net: minor cleanup to net_namespace.c.
Browse files Browse the repository at this point in the history
Inline a small static function that's only ever called from one place.

Signed-off-by: Rob Landley <rlandley@parallels.com>
Reviewed-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rob Landley authored and David S. Miller committed Apr 15, 2011
1 parent c3968a8 commit 911cb19
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions net/core/net_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,14 @@ static void net_free(struct net *net)
kmem_cache_free(net_cachep, net);
}

static struct net *net_create(void)
struct net *copy_net_ns(unsigned long flags, struct net *old_net)
{
struct net *net;
int rv;

if (!(flags & CLONE_NEWNET))
return get_net(old_net);

net = net_alloc();
if (!net)
return ERR_PTR(-ENOMEM);
Expand All @@ -239,13 +242,6 @@ static struct net *net_create(void)
return net;
}

struct net *copy_net_ns(unsigned long flags, struct net *old_net)
{
if (!(flags & CLONE_NEWNET))
return get_net(old_net);
return net_create();
}

static DEFINE_SPINLOCK(cleanup_list_lock);
static LIST_HEAD(cleanup_list); /* Must hold cleanup_list_lock to touch */

Expand Down

0 comments on commit 911cb19

Please sign in to comment.