diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-02 10:10:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-10 22:18:22 -0400 |
commit | 115b4205120dd5347858837dcdc17de0750bddef (patch) | |
tree | 1e19338dbfd887ad4946075fc74eb22c00ea85bd | |
parent | d0deec19917352333e38cfdafe69e796e5dedfbb (diff) |
ext3: switch to simple_follow_link()
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/ext3/inode.c | 1 | ||||
-rw-r--r-- | fs/ext3/namei.c | 3 | ||||
-rw-r--r-- | fs/ext3/symlink.c | 10 |
3 files changed, 4 insertions, 10 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 2ee2dc4351d1..6c7e5468a2f8 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -2999,6 +2999,7 @@ struct inode *ext3_iget(struct super_block *sb, unsigned long ino) | |||
2999 | inode->i_op = &ext3_fast_symlink_inode_operations; | 2999 | inode->i_op = &ext3_fast_symlink_inode_operations; |
3000 | nd_terminate_link(ei->i_data, inode->i_size, | 3000 | nd_terminate_link(ei->i_data, inode->i_size, |
3001 | sizeof(ei->i_data) - 1); | 3001 | sizeof(ei->i_data) - 1); |
3002 | inode->i_link = (char *)ei->i_data; | ||
3002 | } else { | 3003 | } else { |
3003 | inode->i_op = &ext3_symlink_inode_operations; | 3004 | inode->i_op = &ext3_symlink_inode_operations; |
3004 | ext3_set_aops(inode); | 3005 | ext3_set_aops(inode); |
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 4264b9bd0002..c9e767cd4b67 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -2308,7 +2308,8 @@ retry: | |||
2308 | } | 2308 | } |
2309 | } else { | 2309 | } else { |
2310 | inode->i_op = &ext3_fast_symlink_inode_operations; | 2310 | inode->i_op = &ext3_fast_symlink_inode_operations; |
2311 | memcpy((char*)&EXT3_I(inode)->i_data,symname,l); | 2311 | inode->i_link = (char*)&EXT3_I(inode)->i_data; |
2312 | memcpy(inode->i_link, symname, l); | ||
2312 | inode->i_size = l-1; | 2313 | inode->i_size = l-1; |
2313 | } | 2314 | } |
2314 | EXT3_I(inode)->i_disksize = inode->i_size; | 2315 | EXT3_I(inode)->i_disksize = inode->i_size; |
diff --git a/fs/ext3/symlink.c b/fs/ext3/symlink.c index ea96df3c58db..c08c59094ae6 100644 --- a/fs/ext3/symlink.c +++ b/fs/ext3/symlink.c | |||
@@ -17,17 +17,9 @@ | |||
17 | * ext3 symlink handling code | 17 | * ext3 symlink handling code |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/namei.h> | ||
21 | #include "ext3.h" | 20 | #include "ext3.h" |
22 | #include "xattr.h" | 21 | #include "xattr.h" |
23 | 22 | ||
24 | static void * ext3_follow_link(struct dentry *dentry, struct nameidata *nd) | ||
25 | { | ||
26 | struct ext3_inode_info *ei = EXT3_I(d_inode(dentry)); | ||
27 | nd_set_link(nd, (char*)ei->i_data); | ||
28 | return NULL; | ||
29 | } | ||
30 | |||
31 | const struct inode_operations ext3_symlink_inode_operations = { | 23 | const struct inode_operations ext3_symlink_inode_operations = { |
32 | .readlink = generic_readlink, | 24 | .readlink = generic_readlink, |
33 | .follow_link = page_follow_link_light, | 25 | .follow_link = page_follow_link_light, |
@@ -43,7 +35,7 @@ const struct inode_operations ext3_symlink_inode_operations = { | |||
43 | 35 | ||
44 | const struct inode_operations ext3_fast_symlink_inode_operations = { | 36 | const struct inode_operations ext3_fast_symlink_inode_operations = { |
45 | .readlink = generic_readlink, | 37 | .readlink = generic_readlink, |
46 | .follow_link = ext3_follow_link, | 38 | .follow_link = simple_follow_link, |
47 | .setattr = ext3_setattr, | 39 | .setattr = ext3_setattr, |
48 | #ifdef CONFIG_EXT3_FS_XATTR | 40 | #ifdef CONFIG_EXT3_FS_XATTR |
49 | .setxattr = generic_setxattr, | 41 | .setxattr = generic_setxattr, |