提交 5723cb01 编写于 作者: A Al Viro

debugfs: switch to simple_follow_link()

Reviewed-by: NJan Kara <jack@suse.cz>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 60380f19
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/namei.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -43,17 +42,6 @@ const struct file_operations debugfs_file_operations = { ...@@ -43,17 +42,6 @@ const struct file_operations debugfs_file_operations = {
.llseek = noop_llseek, .llseek = noop_llseek,
}; };
static void *debugfs_follow_link(struct dentry *dentry, struct nameidata *nd)
{
nd_set_link(nd, d_inode(dentry)->i_private);
return NULL;
}
const struct inode_operations debugfs_link_operations = {
.readlink = generic_readlink,
.follow_link = debugfs_follow_link,
};
static int debugfs_u8_set(void *data, u64 val) static int debugfs_u8_set(void *data, u64 val)
{ {
*(u8 *)data = val; *(u8 *)data = val;
......
...@@ -174,7 +174,7 @@ static void debugfs_evict_inode(struct inode *inode) ...@@ -174,7 +174,7 @@ static void debugfs_evict_inode(struct inode *inode)
truncate_inode_pages_final(&inode->i_data); truncate_inode_pages_final(&inode->i_data);
clear_inode(inode); clear_inode(inode);
if (S_ISLNK(inode->i_mode)) if (S_ISLNK(inode->i_mode))
kfree(inode->i_private); kfree(inode->i_link);
} }
static const struct super_operations debugfs_super_operations = { static const struct super_operations debugfs_super_operations = {
...@@ -511,8 +511,8 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, ...@@ -511,8 +511,8 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
return failed_creating(dentry); return failed_creating(dentry);
} }
inode->i_mode = S_IFLNK | S_IRWXUGO; inode->i_mode = S_IFLNK | S_IRWXUGO;
inode->i_op = &debugfs_link_operations; inode->i_op = &simple_symlink_inode_operations;
inode->i_private = link; inode->i_link = link;
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
return end_creating(dentry); return end_creating(dentry);
} }
......
...@@ -45,7 +45,6 @@ extern struct dentry *arch_debugfs_dir; ...@@ -45,7 +45,6 @@ extern struct dentry *arch_debugfs_dir;
/* declared over in file.c */ /* declared over in file.c */
extern const struct file_operations debugfs_file_operations; extern const struct file_operations debugfs_file_operations;
extern const struct inode_operations debugfs_link_operations;
struct dentry *debugfs_create_file(const char *name, umode_t mode, struct dentry *debugfs_create_file(const char *name, umode_t mode,
struct dentry *parent, void *data, struct dentry *parent, void *data,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册