From e34cb44ac7c08783b98a16eec70125e205e6eb12 Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Tue, 21 Nov 2017 12:59:41 +0000 Subject: initial commit Generated againts 4.14 kernel source with git backports 1d8cc151d365582b42be00af776270b834a7a37d --- backport-include/linux/debugfs.h | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 backport-include/linux/debugfs.h (limited to 'backport-include/linux/debugfs.h') diff --git a/backport-include/linux/debugfs.h b/backport-include/linux/debugfs.h new file mode 100644 index 0000000..1167038 --- /dev/null +++ b/backport-include/linux/debugfs.h @@ -0,0 +1,56 @@ +#ifndef __BACKPORT_DEBUGFS_H_ +#define __BACKPORT_DEBUGFS_H_ +#include_next +#include +#include +#include + +#if LINUX_VERSION_IS_LESS(3,19,0) +#define debugfs_create_devm_seqfile LINUX_BACKPORT(debugfs_create_devm_seqfile) +#if defined(CONFIG_DEBUG_FS) +struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, + struct dentry *parent, + int (*read_fn)(struct seq_file *s, + void *data)); +#else +static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev, + const char *name, + struct dentry *parent, + int (*read_fn)(struct seq_file *s, + void *data)) +{ + return ERR_PTR(-ENODEV); +} +#endif /* CONFIG_DEBUG_FS */ +#endif /* LINUX_VERSION_IS_LESS(3,19,0) */ + +#if LINUX_VERSION_IS_LESS(4,4,0) +#define debugfs_create_bool LINUX_BACKPORT(debugfs_create_bool) +#ifdef CONFIG_DEBUG_FS +struct dentry *debugfs_create_bool(const char *name, umode_t mode, + struct dentry *parent, bool *value); +#else +static inline struct dentry * +debugfs_create_bool(const char *name, umode_t mode, + struct dentry *parent, bool *value) +{ + return ERR_PTR(-ENODEV); +} +#endif +#endif /* LINUX_VERSION_IS_LESS(4,4,0) */ + +#if LINUX_VERSION_IS_LESS(4,9,0) && \ + !LINUX_VERSION_IN_RANGE(4,8,4, 4,9,0) && \ + !LINUX_VERSION_IN_RANGE(4,7,10, 4,8,0) +static inline const struct file_operations * +debugfs_real_fops(const struct file *filp) +{ + /* + * Neither the pointer to the struct file_operations, nor its + * contents ever change -- srcu_dereference() is not needed here. + */ + return filp->f_path.dentry->d_fsdata; +} +#endif /* <4.9.0 but not >= 4.8.4, 4.7.10 */ + +#endif /* __BACKPORT_DEBUGFS_H_ */ -- cgit v1.2.3