diff options
Diffstat (limited to 'include/linux/seq_file.h')
-rw-r--r-- | include/linux/seq_file.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 83c44eefe698..68a04a343cad 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -13,6 +13,7 @@ struct file; | |||
13 | struct path; | 13 | struct path; |
14 | struct inode; | 14 | struct inode; |
15 | struct dentry; | 15 | struct dentry; |
16 | struct user_namespace; | ||
16 | 17 | ||
17 | struct seq_file { | 18 | struct seq_file { |
18 | char *buf; | 19 | char *buf; |
@@ -25,6 +26,9 @@ struct seq_file { | |||
25 | struct mutex lock; | 26 | struct mutex lock; |
26 | const struct seq_operations *op; | 27 | const struct seq_operations *op; |
27 | int poll_event; | 28 | int poll_event; |
29 | #ifdef CONFIG_USER_NS | ||
30 | struct user_namespace *user_ns; | ||
31 | #endif | ||
28 | void *private; | 32 | void *private; |
29 | }; | 33 | }; |
30 | 34 | ||
@@ -128,6 +132,16 @@ int seq_put_decimal_ull(struct seq_file *m, char delimiter, | |||
128 | int seq_put_decimal_ll(struct seq_file *m, char delimiter, | 132 | int seq_put_decimal_ll(struct seq_file *m, char delimiter, |
129 | long long num); | 133 | long long num); |
130 | 134 | ||
135 | static inline struct user_namespace *seq_user_ns(struct seq_file *seq) | ||
136 | { | ||
137 | #ifdef CONFIG_USER_NS | ||
138 | return seq->user_ns; | ||
139 | #else | ||
140 | extern struct user_namespace init_user_ns; | ||
141 | return &init_user_ns; | ||
142 | #endif | ||
143 | } | ||
144 | |||
131 | #define SEQ_START_TOKEN ((void *)1) | 145 | #define SEQ_START_TOKEN ((void *)1) |
132 | /* | 146 | /* |
133 | * Helpers for iteration over list_head-s in seq_files | 147 | * Helpers for iteration over list_head-s in seq_files |