diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 13:36:06 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 15:39:56 -0400 |
commit | 1218854afa6f659be90b748cf1bc7badee954a35 (patch) | |
tree | 78b83e3941fa7e5a03c04e2e4f6ddb1a08ea38a0 /include/linux | |
parent | 3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9 (diff) |
[NET] NETNS: Omit seq_net_private->net without CONFIG_NET_NS.
Without CONFIG_NET_NS, no namespace other than &init_net exists,
no need to store net in seq_net_private.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/seq_file.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 67c2563961f3..d870a8253769 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/string.h> | 6 | #include <linux/string.h> |
7 | #include <linux/mutex.h> | 7 | #include <linux/mutex.h> |
8 | #include <net/net_namespace.h> | ||
8 | 9 | ||
9 | struct seq_operations; | 10 | struct seq_operations; |
10 | struct file; | 11 | struct file; |
@@ -64,7 +65,9 @@ extern struct list_head *seq_list_next(void *v, struct list_head *head, | |||
64 | 65 | ||
65 | struct net; | 66 | struct net; |
66 | struct seq_net_private { | 67 | struct seq_net_private { |
68 | #ifdef CONFIG_NET_NS | ||
67 | struct net *net; | 69 | struct net *net; |
70 | #endif | ||
68 | }; | 71 | }; |
69 | 72 | ||
70 | int seq_open_net(struct inode *, struct file *, | 73 | int seq_open_net(struct inode *, struct file *, |
@@ -72,7 +75,11 @@ int seq_open_net(struct inode *, struct file *, | |||
72 | int seq_release_net(struct inode *, struct file *); | 75 | int seq_release_net(struct inode *, struct file *); |
73 | static inline struct net *seq_file_net(struct seq_file *seq) | 76 | static inline struct net *seq_file_net(struct seq_file *seq) |
74 | { | 77 | { |
78 | #ifdef CONFIG_NET_NS | ||
75 | return ((struct seq_net_private *)seq->private)->net; | 79 | return ((struct seq_net_private *)seq->private)->net; |
80 | #else | ||
81 | return &init_net; | ||
82 | #endif | ||
76 | } | 83 | } |
77 | 84 | ||
78 | #endif | 85 | #endif |