From: Alexey Dobriyan <adobriyan@gmail.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, rlandley@parallels.com, jpirko@redhat.com
Subject: [PATCH] Revert "net: minor cleanup to net_namespace.c."
Date: Sun, 12 Jun 2011 14:09:50 +0300 [thread overview]
Message-ID: <20110612110950.GA11321@p183.telecom.by> (raw)
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 */
next reply other threads:[~2011-06-12 11:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-12 11:09 Alexey Dobriyan [this message]
2011-06-12 11:29 ` [PATCH] Revert "net: minor cleanup to net_namespace.c." David Miller
2011-06-12 11:39 ` Alexey Dobriyan
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=20110612110950.GA11321@p183.telecom.by \
--to=adobriyan@gmail.com \
--cc=davem@davemloft.net \
--cc=jpirko@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=rlandley@parallels.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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