aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/debugfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/debugfs.h')
-rw-r--r--include/linux/debugfs.h20
1 files changed, 3 insertions, 17 deletions
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index b93efc8feecd..cbee5f4a02a3 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -45,23 +45,6 @@ extern struct dentry *arch_debugfs_dir;
45 45
46extern struct srcu_struct debugfs_srcu; 46extern struct srcu_struct debugfs_srcu;
47 47
48/**
49 * debugfs_real_fops - getter for the real file operation
50 * @filp: a pointer to a struct file
51 *
52 * Must only be called under the protection established by
53 * debugfs_use_file_start().
54 */
55static inline const struct file_operations *debugfs_real_fops(const struct file *filp)
56 __must_hold(&debugfs_srcu)
57{
58 /*
59 * Neither the pointer to the struct file_operations, nor its
60 * contents ever change -- srcu_dereference() is not needed here.
61 */
62 return filp->f_path.dentry->d_fsdata;
63}
64
65#define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt) \ 48#define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt) \
66static int __fops ## _open(struct inode *inode, struct file *file) \ 49static int __fops ## _open(struct inode *inode, struct file *file) \
67{ \ 50{ \
@@ -112,6 +95,9 @@ int debugfs_use_file_start(const struct dentry *dentry, int *srcu_idx)
112 95
113void debugfs_use_file_finish(int srcu_idx) __releases(&debugfs_srcu); 96void debugfs_use_file_finish(int srcu_idx) __releases(&debugfs_srcu);
114 97
98const struct file_operations *debugfs_real_fops(const struct file *filp)
99 __must_hold(&debugfs_srcu);
100
115ssize_t debugfs_attr_read(struct file *file, char __user *buf, 101ssize_t debugfs_attr_read(struct file *file, char __user *buf,
116 size_t len, loff_t *ppos); 102 size_t len, loff_t *ppos);
117ssize_t debugfs_attr_write(struct file *file, const char __user *buf, 103ssize_t debugfs_attr_write(struct file *file, const char __user *buf,