Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

debugfs: switch to simple_follow_link()

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 5723cb01 60380f19

+3 -16
-12
fs/debugfs/file.c
··· 17 17 #include <linux/fs.h> 18 18 #include <linux/seq_file.h> 19 19 #include <linux/pagemap.h> 20 - #include <linux/namei.h> 21 20 #include <linux/debugfs.h> 22 21 #include <linux/io.h> 23 22 #include <linux/slab.h> ··· 40 41 .write = default_write_file, 41 42 .open = simple_open, 42 43 .llseek = noop_llseek, 43 - }; 44 - 45 - static void *debugfs_follow_link(struct dentry *dentry, struct nameidata *nd) 46 - { 47 - nd_set_link(nd, d_inode(dentry)->i_private); 48 - return NULL; 49 - } 50 - 51 - const struct inode_operations debugfs_link_operations = { 52 - .readlink = generic_readlink, 53 - .follow_link = debugfs_follow_link, 54 44 }; 55 45 56 46 static int debugfs_u8_set(void *data, u64 val)
+3 -3
fs/debugfs/inode.c
··· 174 174 truncate_inode_pages_final(&inode->i_data); 175 175 clear_inode(inode); 176 176 if (S_ISLNK(inode->i_mode)) 177 - kfree(inode->i_private); 177 + kfree(inode->i_link); 178 178 } 179 179 180 180 static const struct super_operations debugfs_super_operations = { ··· 511 511 return failed_creating(dentry); 512 512 } 513 513 inode->i_mode = S_IFLNK | S_IRWXUGO; 514 - inode->i_op = &debugfs_link_operations; 515 - inode->i_private = link; 514 + inode->i_op = &simple_symlink_inode_operations; 515 + inode->i_link = link; 516 516 d_instantiate(dentry, inode); 517 517 return end_creating(dentry); 518 518 }
-1
include/linux/debugfs.h
··· 45 45 46 46 /* declared over in file.c */ 47 47 extern const struct file_operations debugfs_file_operations; 48 - extern const struct inode_operations debugfs_link_operations; 49 48 50 49 struct dentry *debugfs_create_file(const char *name, umode_t mode, 51 50 struct dentry *parent, void *data,