Compilation fixes.
Subsystems (5)
cover Compilation fixes.
Hello, Dave!
Recently I have seen several issues post to the netdev@ blaming inclusion of the net_namespace.h from seq_file. This set fixes this problem after two small cleanups.
Regards,
Den
PATCH 1/3 : Merge ifdef CONFIG_NET in include/net/net_namespace.h.
--- include/net/net_namespace.h | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-)
include/net/net_namespace.h +10 -8
@@ -61,25 +61,27 @@ struct net {#endif }; +#ifdef CONFIG_NET /* Init's network namespace */ extern struct net init_net;#define INIT_NET_NS (net_ns) .net_ns = &init_net, -#else -#define INIT_NET_NS (net_ns) -#endif -extern struct list_head net_namespace_list; - -#ifdef CONFIG_NET extern struct net *copy_net_ns (unsigned long flags,struct net *net_ns); -#else + +#else /* CONFIG_NET */ + +#define INIT_NET_NS (net_ns) +static inline struct net *copy_net_ns (unsigned long flags,struct net *net_ns) {/* There is nothing to copy so this is a noop */ return net_ns; } -#endif +#endif /* CONFIG_NET */ + + +extern struct list_head net_namespace_list;#ifdef CONFIG_NET_NS extern void __put_net (struct net *net);
Signature · 1 line
1.5.3.rc5
PATCH 2/3 : Remove ifdef CONFIG_NET braces in fs/proc/proc_net.c.
In reply to Denis V. LunevThey are redundant as this file is linked in iff CONFIG_NET is turned on.
--- fs/proc/proc_net.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
fs/proc/proc_net.c +0 -2
@@ -51,7 +51,6 @@ int seq_open_net(struct inode *ino, struct file *f, }EXPORT_SYMBOL_GPL (seq_open_net); -#ifdef CONFIG_NET int seq_release_net (struct inode *ino,struct file *f) {struct seq_file *seq;
@@ -219,4 +218,3 @@ int __init proc_net_init(void)return register_pernet_subsys (&proc_net_ns_ops); } -#endif /* CONFIG_NET */
Signature · 1 line
1.5.3.rc5
PATCH 3/3 : Do not include net/net_namespace.h from seq_file.h
In reply to Denis V. Lunev--- include/linux/seq_file.h | 22 ---------------------- include/linux/seq_file_net.h | 27 +++++++++++++++++++++++++++ include/net/net_namespace.h | 2 ++ 3 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 include/linux/seq_file_net.h
include/linux/seq_file.h +0 -22
@@ -5,7 +5,6 @@#include <linux/types.h> #include <linux/string.h> #include <linux/mutex.h> -#include <net/net_namespace.h> struct seq_operations ;struct file ;
@@ -63,26 +62,5 @@ extern struct list_head *seq_list_start_head(struct list_head *head,extern struct list_head *seq_list_next (void *v,struct list_head *head,loff_t *ppos); -#ifdef CONFIG_NET -struct net ; -struct seq_net_private { -#ifdef CONFIG_NET_NS -struct net *net; -#endif -}; - -int seq_open_net (struct inode *,struct file *, -const struct seq_operations *,int ); -int seq_release_net (struct inode *,struct file *); -static inline struct net *seq_file_net (struct seq_file *seq) -{ -#ifdef CONFIG_NET_NS -return ((struct seq_net_private *)seq->private)->net; -#else -return &init_net; -#endif -} -#endif /* CONFIG_NET */ -#endif #endif
include/linux/seq_file_net.h new file +27 -0
@@ -0,0 +1,27 @@ +#ifndef __SEQ_FILE_NET_H__ +#define __SEQ_FILE_NET_H__ + +#include <linux/seq_file.h> + +struct net ; +extern struct net init_net; + +struct seq_net_private { +#ifdef CONFIG_NET_NS +struct net *net; +#endif +}; + +int seq_open_net (struct inode *,struct file *, +const struct seq_operations *,int ); +int seq_release_net (struct inode *,struct file *); +static inline struct net *seq_file_net (struct seq_file *seq) +{ +#ifdef CONFIG_NET_NS +return ((struct seq_net_private *)seq->private)->net; +#else +return &init_net; +#endif +} + +#endif
include/net/net_namespace.h +2 -0
@@ -63,6 +63,8 @@ struct net {#ifdef CONFIG_NET +#include <linux/seq_file_net.h> +/* Init's network namespace */ extern struct net init_net;#define INIT_NET_NS (net_ns) .net_ns = &init_net,
Signature · 1 line
1.5.3.rc5
David Miller
maintainerFrom: "Denis V. Lunev" <[email protected]>
Date: Mon, 31 Mar 2008 19:46:01 +0400
Quoted 5 lines
Hello, Dave!
Recently I have seen several issues post to the netdev@ blaming inclusion of the
net_namespace.hfromseq_file. This set fixes this problem after two small cleanups.
All applied, thanks Denis.
I'll push to net-2.6.26 after some build sanity checks.
Quoted 5 lines · David Miller
From: "Denis V. Lunev" <[email protected]>
Date: Mon, 31 Mar 2008 19:46:01 +0400Quoted 2 lines
Hello, Dave!
Quoted 7 lines
Quoted 3 lines
Recently I have seen several issues post to the netdev@ blaming inclusion of the
net_namespace.hfromseq_file. This set fixes this problem after two small cleanups.All applied, thanks Denis.
I'll push to net-2.6.26 after some build sanity checks.
Dave, could you pls conside this addition. This should fix problem reported by the Kamalesh Babulal <[email protected]> recently.
[NETNS]: Declare init_net even without CONFIG_NET defined.
This seems bogus but there is no other way for now. There are several placec when networking headers are included even without CONFIG_NET and the possibility of the similar reports in the nearest future is great.
----
include/net/net_namespace.h +2 -1
@@ -60,11 +60,12 @@ struct net { }; -#ifdef CONFIG_NET #include <linux/seq_file_net.h> /* Init's network namespace */ extern struct net init_net; + +#ifdef CONFIG_NET #define INIT_NET_NS (net_ns) .net_ns = &init_net,extern struct net *copy_net_ns (unsigned long flags,struct net *net_ns);
David Miller
maintainerFrom: "Denis V. Lunev" <[email protected]>
Date: Wed, 02 Apr 2008 14:01:14 +0400
Quoted 10 lines · David Miller
Quoted 9 lines
From: "Denis V. Lunev" <[email protected]>
Date: Mon, 31 Mar 2008 19:46:01 +0400Quoted 5 lines
Hello, Dave!
Recently I have seen several issues post to the netdev@ blaming inclusion of the
net_namespace.hfromseq_file. This set fixes this problem after two small cleanups.
Quoted 6 lines
Quoted 3 lines
All applied, thanks Denis.
I'll push to net-2.6.26 after some build sanity checks.
Dave, could you pls conside this addition. This should fix problem reported by the Kamalesh Babulal <[email protected]> recently.
Then this invalidates enourmous amounts of CONFIG_NET tests we've put into the headers over the past few days.
All of them were explicitly to avoid having to provide the init_net symbol when CONFIG_NET is not set.
Quoted 17 lines · David Miller
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 02 Apr 2008 14:01:14 +0400Quoted 14 lines · David Miller
Quoted 12 lines
From: "Denis V. Lunev" <[email protected]>
Date: Mon, 31 Mar 2008 19:46:01 +0400Quoted 5 lines
Hello, Dave!
Recently I have seen several issues post to the netdev@ blaming inclusion of the
net_namespace.hfromseq_file. This set fixes this problem after two small cleanups.All applied, thanks Denis.
I'll push to net-2.6.26 after some build sanity checks.
Quoted 8 lines
Quoted 2 lines
Dave, could you pls conside this addition. This should fix problem reported by the Kamalesh Babulal <[email protected]> recently.
Then this invalidates enourmous amounts of
CONFIG_NETtests we've put into the headers over the past few days.All of them were explicitly to avoid having to provide the
init_netsymbol whenCONFIG_NETis not set.
OK. do you suggest to insert another CONFIG_NET check into if_pppox header or separate fs/compat_ioctl.c into two files:
- for net ioctls
- for the rest?
Regards,
Den
David Miller
maintainerFrom: "Denis V. Lunev" <[email protected]>
Date: Wed, 02 Apr 2008 23:46:19 +0400
Quoted 10 lines · David Miller
Quoted 9 lines
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 02 Apr 2008 14:01:14 +0400Quoted 2 lines
Dave, could you pls conside this addition. This should fix problem reported by the Kamalesh Babulal <[email protected]> recently.
Then this invalidates enourmous amounts of
CONFIG_NETtests we've put into the headers over the past few days.
Quoted 7 lines
Quoted 2 lines
All of them were explicitly to avoid having to provide the
init_netsymbol whenCONFIG_NETis not set.OK. do you suggest to insert another
CONFIG_NETcheck intoif_pppoxheader or separatefs/compat_ioctl.cinto two files:
- for net ioctls
- for the rest?
It's probably better to go your route. That is, unprotect the init_net extern, and remove the CONFIG_NET's we added which are no longer necessary.
Could you do such a patch set? Thanks.
Quoted 21 lines · David Miller
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 02 Apr 2008 23:46:19 +0400Quoted 10 lines · David Miller
Quoted 9 lines
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 02 Apr 2008 14:01:14 +0400Quoted 2 lines
Dave, could you pls conside this addition. This should fix problem reported by the Kamalesh Babulal <[email protected]> recently.
Then this invalidates enourmous amounts of
CONFIG_NETtests we've put into the headers over the past few days.Quoted 7 lines
Quoted 2 lines
All of them were explicitly to avoid having to provide the
init_netsymbol whenCONFIG_NETis not set.OK. do you suggest to insert another
CONFIG_NETcheck intoif_pppoxheader or separatefs/compat_ioctl.cinto two files:
- for net ioctls
- for the rest?
Quoted 5 lines
It's probably better to go your route. That is, unprotect the
init_netextern, and remove the CONFIG_NET's we added which are no longer necessary.Could you do such a patch set? Thanks.
Sure, but, unfortunately, only tomorrow morning. It is too late today in Moscow :)
David Miller
maintainerFrom: "Denis V. Lunev" <[email protected]>
Date: Thu, 03 Apr 2008 01:00:07 +0400
Quoted 8 lines · David Miller
Quoted 4 lines
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 02 Apr 2008 23:46:19 +0400Could you do such a patch set? Thanks.
Sure, but, unfortunately, only tomorrow morning. It is too late today in Moscow :)
No problem, there is no rush :-)
Quoted 7 lines · David Miller
From: "Denis V. Lunev" <[email protected]>
Date: Thu, 03 Apr 2008 01:00:07 +0400Quoted 4 lines · David Miller
Quoted 3 lines
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 02 Apr 2008 23:46:19 +0400
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Could you do such a patch set? Thanks.
Sure, but, unfortunately, only tomorrow morning. It is too late today in Moscow :)
No problem, there is no rush :-)
pls consider this. I have found only 3 commits related
[NETNS]: Declare init_net even without CONFIG_NET defined.
This does not look good, but there is no other choice. The compilation without CONFIG_NET is broken and can not be fixed with ease.
After that there is no need for the following commits:1567ca7eec7664b8be3b07755ac59dc1b1ec76cb 3edf8fa5ccf10688a9280b5cbca8ed3947c42866 2d38f9a4f8d2ebdc799f03eecf82345825495711
Revert them.
----
include/linux/netdevice.h +0 -4
@@ -741,7 +741,6 @@ struct net_device#define NETDEV_ALIGN 32#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) -#ifdef CONFIG_NET /* * Net namespace inlines */
@@ -762,7 +761,6 @@ void dev_net_set(struct net_device *dev, struct net *net) dev->nd_net = net;#endif } -#endif /** * netdev_priv - access network device private data
@@ -827,7 +825,6 @@ struct packet_type {extern rwlock_t dev_base_lock;/* Device list lock */ -#ifdef CONFIG_NET #define for_each_netdev (net, d) \ list_for_each_entry(d, &(net)->dev_base_head, dev_list)#define for_each_netdev_safe (net, d, n) \
@@ -851,7 +848,6 @@ static inline struct net_device *first_net_device(struct net *net)return list_empty (&net->dev_base_head) ?NULL :net_device_entry (net->dev_base_head.next); } -#endif extern int netdev_boot_setup_check (struct net_device *dev);extern unsigned long netdev_boot_base (const char *prefix,int unit);
include/net/net_namespace.h +2 -1
@@ -60,11 +60,12 @@ struct net { }; -#ifdef CONFIG_NET #include <linux/seq_file_net.h> /* Init's network namespace */ extern struct net init_net; + +#ifdef CONFIG_NET #define INIT_NET_NS (net_ns) .net_ns = &init_net,extern struct net *copy_net_ns (unsigned long flags,struct net *net_ns);
lib/kobject_uevent.c +0 -2
@@ -19,12 +19,10 @@#include <linux/kobject.h> #include <linux/module.h> -#ifdef CONFIG_NET #include <linux/socket.h> #include <linux/skbuff.h> #include <linux/netlink.h> #include <net/sock.h> -#endif u64 uevent_seqnum;
From: "Denis V. Lunev" <[email protected]>
Date: Thu, 03 Apr 2008 18:13:52 +0400
Quoted 8 lines · David Miller
Quoted 7 lines
From: "Denis V. Lunev" <[email protected]>
Date: Thu, 03 Apr 2008 01:00:07 +0400Quoted 4 lines · David Miller
Quoted 3 lines
From: "Denis V. Lunev" <[email protected]>
Date: Wed, 02 Apr 2008 23:46:19 +0400
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Could you do such a patch set? Thanks.
Sure, but, unfortunately, only tomorrow morning. It is too late today in Moscow :)
No problem, there is no rush :-)
pls consider this. I have found only 3 commits related
Applied, thanks a lot for doing this work.