Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
[firefly-linux-kernel-4.4.55.git] / include / linux / seq_file.h
index 83c44eefe698ba97a72700b8cac63a37fb558c82..68a04a343cadecc121ae9dc2515fa4c3d83a6105 100644 (file)
@@ -13,6 +13,7 @@ struct file;
 struct path;
 struct inode;
 struct dentry;
+struct user_namespace;
 
 struct seq_file {
        char *buf;
@@ -25,6 +26,9 @@ struct seq_file {
        struct mutex lock;
        const struct seq_operations *op;
        int poll_event;
+#ifdef CONFIG_USER_NS
+       struct user_namespace *user_ns;
+#endif
        void *private;
 };
 
@@ -128,6 +132,16 @@ int seq_put_decimal_ull(struct seq_file *m, char delimiter,
 int seq_put_decimal_ll(struct seq_file *m, char delimiter,
                        long long num);
 
+static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
+{
+#ifdef CONFIG_USER_NS
+       return seq->user_ns;
+#else
+       extern struct user_namespace init_user_ns;
+       return &init_user_ns;
+#endif
+}
+
 #define SEQ_START_TOKEN ((void *)1)
 /*
  * Helpers for iteration over list_head-s in seq_files