aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 063fdfcf8275..1bae189f3245 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1712,24 +1712,30 @@ static int gfs2_rename2(struct inode *odir, struct dentry *odentry,
1712} 1712}
1713 1713
1714/** 1714/**
1715 * gfs2_follow_link - Follow a symbolic link 1715 * gfs2_get_link - Follow a symbolic link
1716 * @dentry: The dentry of the link 1716 * @dentry: The dentry of the link
1717 * @nd: Data that we pass to vfs_follow_link() 1717 * @inode: The inode of the link
1718 * @done: destructor for return value
1718 * 1719 *
1719 * This can handle symlinks of any size. 1720 * This can handle symlinks of any size.
1720 * 1721 *
1721 * Returns: 0 on success or error code 1722 * Returns: 0 on success or error code
1722 */ 1723 */
1723 1724
1724static const char *gfs2_follow_link(struct dentry *dentry, void **cookie) 1725static const char *gfs2_get_link(struct dentry *dentry,
1726 struct inode *inode,
1727 struct delayed_call *done)
1725{ 1728{
1726 struct gfs2_inode *ip = GFS2_I(d_inode(dentry)); 1729 struct gfs2_inode *ip = GFS2_I(inode);
1727 struct gfs2_holder i_gh; 1730 struct gfs2_holder i_gh;
1728 struct buffer_head *dibh; 1731 struct buffer_head *dibh;
1729 unsigned int size; 1732 unsigned int size;
1730 char *buf; 1733 char *buf;
1731 int error; 1734 int error;
1732 1735
1736 if (!dentry)
1737 return ERR_PTR(-ECHILD);
1738
1733 gfs2_holder_init(ip->i_gl, LM_ST_SHARED, 0, &i_gh); 1739 gfs2_holder_init(ip->i_gl, LM_ST_SHARED, 0, &i_gh);
1734 error = gfs2_glock_nq(&i_gh); 1740 error = gfs2_glock_nq(&i_gh);
1735 if (error) { 1741 if (error) {
@@ -1759,7 +1765,7 @@ static const char *gfs2_follow_link(struct dentry *dentry, void **cookie)
1759out: 1765out:
1760 gfs2_glock_dq_uninit(&i_gh); 1766 gfs2_glock_dq_uninit(&i_gh);
1761 if (!IS_ERR(buf)) 1767 if (!IS_ERR(buf))
1762 *cookie = buf; 1768 set_delayed_call(done, kfree_link, buf);
1763 return buf; 1769 return buf;
1764} 1770}
1765 1771
@@ -2132,8 +2138,7 @@ const struct inode_operations gfs2_dir_iops = {
2132 2138
2133const struct inode_operations gfs2_symlink_iops = { 2139const struct inode_operations gfs2_symlink_iops = {
2134 .readlink = generic_readlink, 2140 .readlink = generic_readlink,
2135 .follow_link = gfs2_follow_link, 2141 .get_link = gfs2_get_link,
2136 .put_link = kfree_put_link,
2137 .permission = gfs2_permission, 2142 .permission = gfs2_permission,
2138 .setattr = gfs2_setattr, 2143 .setattr = gfs2_setattr,
2139 .getattr = gfs2_getattr, 2144 .getattr = gfs2_getattr,