summaryrefslogtreecommitdiffstats
path: root/backport-include/linux/seq_file.h
diff options
context:
space:
mode:
authorroot <root@artemis.panaceas.org>2015-12-25 15:00:15 +0000
committerroot <root@artemis.panaceas.org>2015-12-25 15:00:15 +0000
commitddd86436f4e3643c04b797f858dab95d5f2e4de9 (patch)
treebfe7a780cf9a2f4fc33aec32c82e625e79dece1f /backport-include/linux/seq_file.h
downloadbackports-3.10.19-1-ddd86436f4e3643c04b797f858dab95d5f2e4de9.tar.gz
backports-3.10.19-1-ddd86436f4e3643c04b797f858dab95d5f2e4de9.tar.bz2
backports-3.10.19-1-ddd86436f4e3643c04b797f858dab95d5f2e4de9.zip
Diffstat (limited to 'backport-include/linux/seq_file.h')
-rw-r--r--backport-include/linux/seq_file.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/backport-include/linux/seq_file.h b/backport-include/linux/seq_file.h
new file mode 100644
index 0000000..17f7b3d
--- /dev/null
+++ b/backport-include/linux/seq_file.h
@@ -0,0 +1,44 @@
+#ifndef __BACKPORT_SEQ_FILE_H
+#define __BACKPORT_SEQ_FILE_H
+#include_next <linux/seq_file.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+#include <linux/user_namespace.h>
+#include <linux/file.h>
+#include <linux/fs.h>
+#ifdef CONFIG_USER_NS
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)
+static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
+{
+ struct file *f = container_of((void *) seq, struct file, private_data);
+
+ return f->f_cred->user_ns;
+}
+#else
+static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
+{
+ return current_user_ns();
+}
+#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) */
+
+#else
+static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
+{
+ extern struct user_namespace init_user_ns;
+ return &init_user_ns;
+}
+#endif /* CONFIG_USER_NS */
+#endif /* < 3.7 */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+#define seq_hlist_start_head LINUX_BACKPORT(seq_hlist_start_head)
+extern struct hlist_node *seq_hlist_start_head(struct hlist_head *head,
+ loff_t pos);
+
+#define seq_hlist_next LINUX_BACKPORT(seq_hlist_next)
+extern struct hlist_node *seq_hlist_next(void *v, struct hlist_head *head,
+ loff_t *ppos);
+#endif
+
+#endif /* __BACKPORT_SEQ_FILE_H */