Commit 60380f19 authored by Al Viro's avatar Al Viro

shmem: switch to simple_follow_link()

Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent a8db149f
...@@ -2451,6 +2451,7 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s ...@@ -2451,6 +2451,7 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
return -ENOMEM; return -ENOMEM;
} }
inode->i_op = &shmem_short_symlink_operations; inode->i_op = &shmem_short_symlink_operations;
inode->i_link = info->symlink;
} else { } else {
error = shmem_getpage(inode, 0, &page, SGP_WRITE, NULL); error = shmem_getpage(inode, 0, &page, SGP_WRITE, NULL);
if (error) { if (error) {
...@@ -2474,12 +2475,6 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s ...@@ -2474,12 +2475,6 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
return 0; return 0;
} }
static void *shmem_follow_short_symlink(struct dentry *dentry, struct nameidata *nd)
{
nd_set_link(nd, SHMEM_I(d_inode(dentry))->symlink);
return NULL;
}
static void *shmem_follow_link(struct dentry *dentry, struct nameidata *nd) static void *shmem_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
struct page *page = NULL; struct page *page = NULL;
...@@ -2642,7 +2637,7 @@ static ssize_t shmem_listxattr(struct dentry *dentry, char *buffer, size_t size) ...@@ -2642,7 +2637,7 @@ static ssize_t shmem_listxattr(struct dentry *dentry, char *buffer, size_t size)
static const struct inode_operations shmem_short_symlink_operations = { static const struct inode_operations shmem_short_symlink_operations = {
.readlink = generic_readlink, .readlink = generic_readlink,
.follow_link = shmem_follow_short_symlink, .follow_link = simple_follow_link,
#ifdef CONFIG_TMPFS_XATTR #ifdef CONFIG_TMPFS_XATTR
.setxattr = shmem_setxattr, .setxattr = shmem_setxattr,
.getxattr = shmem_getxattr, .getxattr = shmem_getxattr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment