diff options
author | Dave Chinner <david@fromorbit.com> | 2016-05-20 02:32:10 +0200 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-05-20 02:32:10 +0200 |
commit | 5b9113547fedca92bb39b828f7f8cd11a153247b (patch) | |
tree | f6b489073b1584d8179bf553e6f90e91f9e79e83 /fs/xfs/xfs_ioctl.c | |
parent | Merge branch 'xfs-4.7-trans-type-cleanup' into for-next (diff) | |
parent | xfs: optimize inline symlinks (diff) | |
download | linux-5b9113547fedca92bb39b828f7f8cd11a153247b.tar.xz linux-5b9113547fedca92bb39b828f7f8cd11a153247b.zip |
Merge branch 'xfs-4.7-optimise-inline-symlinks' into for-next
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 6f82187ee297..dbca7375deef 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -277,7 +277,6 @@ xfs_readlink_by_handle( { struct dentry *dentry; __u32 olen; - void *link; int error; if (!capable(CAP_SYS_ADMIN)) @@ -288,7 +287,7 @@ xfs_readlink_by_handle( return PTR_ERR(dentry); /* Restrict this handle operation to symlinks only. */ - if (!d_is_symlink(dentry)) { + if (!d_inode(dentry)->i_op->readlink) { error = -EINVAL; goto out_dput; } @@ -298,21 +297,8 @@ xfs_readlink_by_handle( goto out_dput; } - link = kmalloc(MAXPATHLEN+1, GFP_KERNEL); - if (!link) { - error = -ENOMEM; - goto out_dput; - } - - error = xfs_readlink(XFS_I(d_inode(dentry)), link); - if (error) - goto out_kfree; - error = readlink_copy(hreq->ohandle, olen, link); - if (error) - goto out_kfree; + error = d_inode(dentry)->i_op->readlink(dentry, hreq->ohandle, olen); - out_kfree: - kfree(link); out_dput: dput(dentry); return error; |