aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/seq_file.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/seq_file.h')
-rw-r--r--include/linux/seq_file.h14
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;
13struct path; 13struct path;
14struct inode; 14struct inode;
15struct dentry; 15struct dentry;
16struct user_namespace;
16 17
17struct seq_file { 18struct 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,
128int seq_put_decimal_ll(struct seq_file *m, char delimiter, 132int seq_put_decimal_ll(struct seq_file *m, char delimiter,
129 long long num); 133 long long num);
130 134
135static 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