netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] minor cleanup to net_namespace.c.
@ 2011-04-15 12:26 Rob Landley
  2011-04-15 12:37 ` Jiri Pirko
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Landley @ 2011-04-15 12:26 UTC (permalink / raw)
  To: linux-kernel, netdev, jpirko, eric.dumazet

From: Rob Landley <rlandley@parallels.com>

Inline a small static function that's only ever called from one place.

Signed-off-by: Rob Landley <rlandley@parallels.com>
---

 net/core/net_namespace.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 3f86026..1abb508 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 */


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] minor cleanup to net_namespace.c.
  2011-04-15 12:26 [PATCH] minor cleanup to net_namespace.c Rob Landley
@ 2011-04-15 12:37 ` Jiri Pirko
  2011-04-15 22:48   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2011-04-15 12:37 UTC (permalink / raw)
  To: Rob Landley; +Cc: linux-kernel, netdev, eric.dumazet

Fri, Apr 15, 2011 at 02:26:25PM CEST, rlandley@parallels.com wrote:
>From: Rob Landley <rlandley@parallels.com>
>
>Inline a small static function that's only ever called from one place.
>
>Signed-off-by: Rob Landley <rlandley@parallels.com>
>---
>
> net/core/net_namespace.c |   12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
>diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
>index 3f86026..1abb508 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 */
>

Reviewed-by: Jiri Pirko <jpirko@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] minor cleanup to net_namespace.c.
  2011-04-15 12:37 ` Jiri Pirko
@ 2011-04-15 22:48   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-04-15 22:48 UTC (permalink / raw)
  To: jpirko; +Cc: rlandley, linux-kernel, netdev, eric.dumazet

From: Jiri Pirko <jpirko@redhat.com>
Date: Fri, 15 Apr 2011 14:37:52 +0200

> Fri, Apr 15, 2011 at 02:26:25PM CEST, rlandley@parallels.com wrote:
>>From: Rob Landley <rlandley@parallels.com>
>>
>>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>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-15 22:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-15 12:26 [PATCH] minor cleanup to net_namespace.c Rob Landley
2011-04-15 12:37 ` Jiri Pirko
2011-04-15 22:48   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).