diff options
Diffstat (limited to 'fs/debugfs/file.c')
-rw-r--r-- | fs/debugfs/file.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 8d130cc8532..682f928b7f4 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -16,6 +16,7 @@ #include <linux/module.h> #include <linux/fs.h> #include <linux/pagemap.h> +#include <linux/namei.h> #include <linux/debugfs.h> static ssize_t default_read_file(struct file *file, char __user *buf, @@ -44,6 +45,17 @@ const struct file_operations debugfs_file_operations = { .open = default_open, }; +static void *debugfs_follow_link(struct dentry *dentry, struct nameidata *nd) +{ + nd_set_link(nd, dentry->d_inode->i_private); + return NULL; +} + +const struct inode_operations debugfs_link_operations = { + .readlink = generic_readlink, + .follow_link = debugfs_follow_link, +}; + static void debugfs_u8_set(void *data, u64 val) { *(u8 *)data = val; |