]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - include/linux/debugfs.h
kthread: initial support for delayed kthread work
[mirror_ubuntu-zesty-kernel.git] / include / linux / debugfs.h
index 1438e2322d5cf4f15f67db29076d013a4cd157c7..4d3f0d1aec73b856552f5d5e30b706ef5d2e04ec 100644 (file)
@@ -45,6 +45,23 @@ extern struct dentry *arch_debugfs_dir;
 
 extern struct srcu_struct debugfs_srcu;
 
+/**
+ * debugfs_real_fops - getter for the real file operation
+ * @filp: a pointer to a struct file
+ *
+ * Must only be called under the protection established by
+ * debugfs_use_file_start().
+ */
+static inline const struct file_operations *debugfs_real_fops(struct file *filp)
+       __must_hold(&debugfs_srcu)
+{
+       /*
+        * 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;
+}
+
 #if defined(CONFIG_DEBUG_FS)
 
 struct dentry *debugfs_create_file(const char *name, umode_t mode,