diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-02 17:24:43 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-11 05:18:24 +0300 |
commit | 60380f193ee5a667842a4da4a3e936689bb0e5e6 (patch) | |
tree | b57a10b9927dfb3635a66eaaecc99f49f7be441f /mm/shmem.c | |
parent | a8db149fc97b122ffd14e1a5f6a110124dd721ea (diff) | |
download | linux-60380f193ee5a667842a4da4a3e936689bb0e5e6.tar.xz |
shmem: 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 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index de981370fbc5..7f6e2f889122 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2451,6 +2451,7 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s return -ENOMEM; } inode->i_op = &shmem_short_symlink_operations; + inode->i_link = info->symlink; } else { error = shmem_getpage(inode, 0, &page, SGP_WRITE, NULL); if (error) { @@ -2474,12 +2475,6 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s 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) { struct page *page = NULL; @@ -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 = { .readlink = generic_readlink, - .follow_link = shmem_follow_short_symlink, + .follow_link = simple_follow_link, #ifdef CONFIG_TMPFS_XATTR .setxattr = shmem_setxattr, .getxattr = shmem_getxattr, |