diff options
author | Christoph Hellwig <hch@lst.de> | 2016-04-05 23:53:29 +0200 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-04-05 23:53:29 +0200 |
commit | 30ee052e12b97c190b27fe6f20e3ac3047df7b5c (patch) | |
tree | 92b34446e88e72e6ddce730b1f1b4192614a45be /fs/xfs/xfs_symlink.c | |
parent | xfs: use ->readlink to implement the readlink_by_handle ioctl (diff) | |
download | linux-30ee052e12b97c190b27fe6f20e3ac3047df7b5c.tar.xz linux-30ee052e12b97c190b27fe6f20e3ac3047df7b5c.zip |
xfs: optimize inline symlinks
By overallocating the in-core inode fork data buffer and zero
terminating the link target in xfs_init_local_fork we can avoid
the memory allocation in ->follow_link.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_symlink.c')
-rw-r--r-- | fs/xfs/xfs_symlink.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index b69f4a770fc9..5961c1e880c2 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c @@ -131,6 +131,8 @@ xfs_readlink( trace_xfs_readlink(ip); + ASSERT(!(ip->i_df.if_flags & XFS_IFINLINE)); + if (XFS_FORCED_SHUTDOWN(mp)) return -EIO; @@ -150,12 +152,7 @@ xfs_readlink( } - if (ip->i_df.if_flags & XFS_IFINLINE) { - memcpy(link, ip->i_df.if_u1.if_data, pathlen); - link[pathlen] = '\0'; - } else { - error = xfs_readlink_bmap(ip, link); - } + error = xfs_readlink_bmap(ip, link); out: xfs_iunlock(ip, XFS_ILOCK_SHARED); |