diff options
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 |