aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-05-03 10:14:29 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-29 23:28:40 -0400
commitea022dfb3c2a4680483b00eb2fecc9fc4f6091d1 (patch)
treea1fc74b921ef4ea32603492f2a500b016e15e377 /fs/ocfs2/namei.c
parent408bd629badbd4353b238ab6f58001529b274d73 (diff)
ocfs: simplify symlink handling
seeing that "fast" symlinks still get allocation + copy, we might as well simply switch them to pagecache-based variant of ->follow_link(); just need an appropriate ->readpage() for them... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r--fs/ocfs2/namei.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index a9856e3eaaf0..9f39c640cddf 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -1724,15 +1724,16 @@ static int ocfs2_symlink(struct inode *dir,
1724 fe = (struct ocfs2_dinode *) new_fe_bh->b_data; 1724 fe = (struct ocfs2_dinode *) new_fe_bh->b_data;
1725 inode->i_rdev = 0; 1725 inode->i_rdev = 0;
1726 newsize = l - 1; 1726 newsize = l - 1;
1727 inode->i_op = &ocfs2_symlink_inode_operations;
1727 if (l > ocfs2_fast_symlink_chars(sb)) { 1728 if (l > ocfs2_fast_symlink_chars(sb)) {
1728 u32 offset = 0; 1729 u32 offset = 0;
1729 1730
1730 inode->i_op = &ocfs2_symlink_inode_operations;
1731 status = dquot_alloc_space_nodirty(inode, 1731 status = dquot_alloc_space_nodirty(inode,
1732 ocfs2_clusters_to_bytes(osb->sb, 1)); 1732 ocfs2_clusters_to_bytes(osb->sb, 1));
1733 if (status) 1733 if (status)
1734 goto bail; 1734 goto bail;
1735 did_quota = 1; 1735 did_quota = 1;
1736 inode->i_mapping->a_ops = &ocfs2_aops;
1736 status = ocfs2_add_inode_data(osb, inode, &offset, 1, 0, 1737 status = ocfs2_add_inode_data(osb, inode, &offset, 1, 0,
1737 new_fe_bh, 1738 new_fe_bh,
1738 handle, data_ac, NULL, 1739 handle, data_ac, NULL,
@@ -1750,7 +1751,7 @@ static int ocfs2_symlink(struct inode *dir,
1750 i_size_write(inode, newsize); 1751 i_size_write(inode, newsize);
1751 inode->i_blocks = ocfs2_inode_sector_count(inode); 1752 inode->i_blocks = ocfs2_inode_sector_count(inode);
1752 } else { 1753 } else {
1753 inode->i_op = &ocfs2_fast_symlink_inode_operations; 1754 inode->i_mapping->a_ops = &ocfs2_fast_symlink_aops;
1754 memcpy((char *) fe->id2.i_symlink, symname, l); 1755 memcpy((char *) fe->id2.i_symlink, symname, l);
1755 i_size_write(inode, newsize); 1756 i_size_write(inode, newsize);
1756 inode->i_blocks = 0; 1757 inode->i_blocks = 0;