Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

jfs: switch to simple_follow_link()

Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro ad476fed 2e03f3ea

+5 -13
+2 -1
fs/jfs/inode.c
··· 63 63 inode->i_mapping->a_ops = &jfs_aops; 64 64 } else { 65 65 inode->i_op = &jfs_fast_symlink_inode_operations; 66 + inode->i_link = JFS_IP(inode)->i_inline; 66 67 /* 67 68 * The inline data should be null-terminated, but 68 69 * don't let on-disk corruption crash the kernel 69 70 */ 70 - JFS_IP(inode)->i_inline[inode->i_size] = '\0'; 71 + inode->i_link[inode->i_size] = '\0'; 71 72 } 72 73 } else { 73 74 inode->i_op = &jfs_file_inode_operations;
+2 -3
fs/jfs/namei.c
··· 880 880 int ssize; /* source pathname size */ 881 881 struct btstack btstack; 882 882 struct inode *ip = d_inode(dentry); 883 - unchar *i_fastsymlink; 884 883 s64 xlen = 0; 885 884 int bmask = 0, xsize; 886 885 s64 xaddr; ··· 945 946 if (ssize <= IDATASIZE) { 946 947 ip->i_op = &jfs_fast_symlink_inode_operations; 947 948 948 - i_fastsymlink = JFS_IP(ip)->i_inline; 949 - memcpy(i_fastsymlink, name, ssize); 949 + ip->i_link = JFS_IP(ip)->i_inline; 950 + memcpy(ip->i_link, name, ssize); 950 951 ip->i_size = ssize - 1; 951 952 952 953 /*
+1 -9
fs/jfs/symlink.c
··· 17 17 */ 18 18 19 19 #include <linux/fs.h> 20 - #include <linux/namei.h> 21 20 #include "jfs_incore.h" 22 21 #include "jfs_inode.h" 23 22 #include "jfs_xattr.h" 24 23 25 - static void *jfs_follow_link(struct dentry *dentry, struct nameidata *nd) 26 - { 27 - char *s = JFS_IP(d_inode(dentry))->i_inline; 28 - nd_set_link(nd, s); 29 - return NULL; 30 - } 31 - 32 24 const struct inode_operations jfs_fast_symlink_inode_operations = { 33 25 .readlink = generic_readlink, 34 - .follow_link = jfs_follow_link, 26 + .follow_link = simple_follow_link, 35 27 .setattr = jfs_setattr, 36 28 .setxattr = jfs_setxattr, 37 29 .getxattr = jfs_getxattr,