summaryrefslogtreecommitdiffstats
path: root/net/core/net_namespace.c
diff options
context:
space:
mode:
authorRob Landley <rlandley@parallels.com>2011-04-15 02:26:25 +0000
committerDavid S. Miller <davem@davemloft.net>2011-04-15 15:47:51 -0700
commit911cb193f3eb0370f20fbba712211e55ffede4de (patch)
tree853892fe31f307aad7c9501c8429668522eb6626 /net/core/net_namespace.c
parentc3968a857a6b6c3d2ef4ead35776b055fb664d74 (diff)
downloadlinux-911cb193f3eb0370f20fbba712211e55ffede4de.tar.gz
linux-911cb193f3eb0370f20fbba712211e55ffede4de.tar.bz2
linux-911cb193f3eb0370f20fbba712211e55ffede4de.zip
net: minor cleanup to net_namespace.c.
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>
Diffstat (limited to 'net/core/net_namespace.c')
-rw-r--r--net/core/net_namespace.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 3f860261c5ee..1abb50841046 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -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);
@@ -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 */