Netdev List
 help / color / mirror / Atom feed
* [PATCH] Revert "net: minor cleanup to net_namespace.c."
@ 2011-06-12 11:09 Alexey Dobriyan
  2011-06-12 11:29 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2011-06-12 11:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, rlandley, jpirko

git revert 911cb193f3eb0370f20fbba712211e55ffede4de

	commit 911cb193f3eb0370f20fbba712211e55ffede4de
	Author: Rob Landley <rlandley@parallels.com>
	Date:   Fri Apr 15 02:26:25 2011 +0000
	
	    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>

Rationale for net_create() still holds:
* C/R and other out-of-tree code uses or will use it,
* permissions checks are separate thing (and different in C/R case),
* one function doesn't hurt anything.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

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

--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -210,14 +210,11 @@ static void net_free(struct net *net)
 	kmem_cache_free(net_cachep, net);
 }
 
-struct net *copy_net_ns(unsigned long flags, struct net *old_net)
+static struct net *net_create(void)
 {
 	struct net *net;
 	int rv;
 
-	if (!(flags & CLONE_NEWNET))
-		return get_net(old_net);
-
 	net = net_alloc();
 	if (!net)
 		return ERR_PTR(-ENOMEM);
@@ -236,6 +233,13 @@ struct net *copy_net_ns(unsigned long flags, struct net *old_net)
 	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	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-12 11:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-12 11:09 [PATCH] Revert "net: minor cleanup to net_namespace.c." Alexey Dobriyan
2011-06-12 11:29 ` David Miller
2011-06-12 11:39   ` Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox