aboutsummaryrefslogtreecommitdiffstats
path: root/fs/debugfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-05-02 10:27:18 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-05-10 22:18:24 -0400
commit5723cb01f0295ace2b029b0737dd6525a2de337f (patch)
tree3a3fbf87e10652731fabe25d1ce1e566c38fe011 /fs/debugfs
parent60380f193ee5a667842a4da4a3e936689bb0e5e6 (diff)
debugfs: switch to simple_follow_link()
Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/debugfs')
-rw-r--r--fs/debugfs/file.c12
-rw-r--r--fs/debugfs/inode.c6
2 files changed, 3 insertions, 15 deletions
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 830a7e76f5c6..284f9aa0028b 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -17,7 +17,6 @@
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/seq_file.h> 18#include <linux/seq_file.h>
19#include <linux/pagemap.h> 19#include <linux/pagemap.h>
20#include <linux/namei.h>
21#include <linux/debugfs.h> 20#include <linux/debugfs.h>
22#include <linux/io.h> 21#include <linux/io.h>
23#include <linux/slab.h> 22#include <linux/slab.h>
@@ -43,17 +42,6 @@ const struct file_operations debugfs_file_operations = {
43 .llseek = noop_llseek, 42 .llseek = noop_llseek,
44}; 43};
45 44
46static void *debugfs_follow_link(struct dentry *dentry, struct nameidata *nd)
47{
48 nd_set_link(nd, d_inode(dentry)->i_private);
49 return NULL;
50}
51
52const struct inode_operations debugfs_link_operations = {
53 .readlink = generic_readlink,
54 .follow_link = debugfs_follow_link,
55};
56
57static int debugfs_u8_set(void *data, u64 val) 45static int debugfs_u8_set(void *data, u64 val)
58{ 46{
59 *(u8 *)data = val; 47 *(u8 *)data = val;
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index c1e7ffb0dab6..7eaec88ea970 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -174,7 +174,7 @@ static void debugfs_evict_inode(struct inode *inode)
174 truncate_inode_pages_final(&inode->i_data); 174 truncate_inode_pages_final(&inode->i_data);
175 clear_inode(inode); 175 clear_inode(inode);
176 if (S_ISLNK(inode->i_mode)) 176 if (S_ISLNK(inode->i_mode))
177 kfree(inode->i_private); 177 kfree(inode->i_link);
178} 178}
179 179
180static const struct super_operations debugfs_super_operations = { 180static const struct super_operations debugfs_super_operations = {
@@ -511,8 +511,8 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
511 return failed_creating(dentry); 511 return failed_creating(dentry);
512 } 512 }
513 inode->i_mode = S_IFLNK | S_IRWXUGO; 513 inode->i_mode = S_IFLNK | S_IRWXUGO;
514 inode->i_op = &debugfs_link_operations; 514 inode->i_op = &simple_symlink_inode_operations;
515 inode->i_private = link; 515 inode->i_link = link;
516 d_instantiate(dentry, inode); 516 d_instantiate(dentry, inode);
517 return end_creating(dentry); 517 return end_creating(dentry);
518} 518}