mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Miller <davem@davemloft.net>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH] net: Fix build without CONFIG_NET_NS
Date: Tue, 24 Feb 2009 13:26:45 +1100	[thread overview]
Message-ID: <20090224022734.1766BDDE1D@ozlabs.org> (raw)

Commit 486a87f1e5624096bd1c09e9e716239597d48dca broke build without
CONFIG_NET_NS due to calling net_alloc_generic() always while defining
it inside an #ifdef CONFIG_NET_NS block. This moves the function
definition out of that block.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 net/core/net_namespace.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- linux-work.orig/net/core/net_namespace.c	2009-02-24 13:20:42.000000000 +1100
+++ linux-work/net/core/net_namespace.c	2009-02-24 13:24:19.000000000 +1100
@@ -63,10 +63,6 @@ out_undo:
 	goto out;
 }
 
-#ifdef CONFIG_NET_NS
-static struct kmem_cache *net_cachep;
-static struct workqueue_struct *netns_wq;
-
 static struct net_generic *net_alloc_generic(void)
 {
 	struct net_generic *ng;
@@ -80,6 +76,10 @@ static struct net_generic *net_alloc_gen
 	return ng;
 }
 
+#ifdef CONFIG_NET_NS
+static struct kmem_cache *net_cachep;
+static struct workqueue_struct *netns_wq;
+
 static struct net *net_alloc(void)
 {
 	struct net *net = NULL;
@@ -218,7 +218,7 @@ static int __init net_ns_init(void)
 	netns_wq = create_singlethread_workqueue("netns");
 	if (!netns_wq)
 		panic("Could not create netns workq");
-#endif
+#endif /* CONFIG_NET_NS */
 
 	ng = net_alloc_generic();
 	if (!ng)

             reply	other threads:[~2009-02-24  2:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24  2:26 Benjamin Herrenschmidt [this message]
2009-02-24  2:39 ` 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=20090224022734.1766BDDE1D@ozlabs.org \
    --to=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®