public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Rob Landley <rlandley@parallels•com>
To: <linux-kernel@vger•kernel.org>, <netdev@vger•kernel.org>,
	<jpirko@redhat•com>, <eric.dumazet@gmail•com>
Subject: [PATCH] minor cleanup to net_namespace.c.
Date: Fri, 15 Apr 2011 07:26:25 -0500	[thread overview]
Message-ID: <4DA83971.7010903@parallels.com> (raw)

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 */


             reply	other threads:[~2011-04-15 12:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 12:26 Rob Landley [this message]
2011-04-15 12:37 ` [PATCH] minor cleanup to net_namespace.c Jiri Pirko
2011-04-15 22:48   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DA83971.7010903@parallels.com \
    --to=rlandley@parallels$(echo .)com \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=jpirko@redhat$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox