jfs: switch to simple_follow_link()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 2 May 2015 14:41:20 +0000 (10:41 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 11 May 2015 02:18:26 +0000 (22:18 -0400)
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>
fs/jfs/inode.c
fs/jfs/namei.c
fs/jfs/symlink.c

index 070dc4b335449423091e67dd74c0f1c34617b041..6f1cb2b5ee285dd50622f719296fe71284d5f826 100644 (file)
@@ -63,11 +63,12 @@ struct inode *jfs_iget(struct super_block *sb, unsigned long ino)
                        inode->i_mapping->a_ops = &jfs_aops;
                } else {
                        inode->i_op = &jfs_fast_symlink_inode_operations;
+                       inode->i_link = JFS_IP(inode)->i_inline;
                        /*
                         * The inline data should be null-terminated, but
                         * don't let on-disk corruption crash the kernel
                         */
-                       JFS_IP(inode)->i_inline[inode->i_size] = '\0';
+                       inode->i_link[inode->i_size] = '\0';
                }
        } else {
                inode->i_op = &jfs_file_inode_operations;
index 66db7bc0ed1096050c2b2f93c3aa9e16a0ba4726..e33be921aa41b5ae56a4054605aaeea5b8065987 100644 (file)
@@ -880,7 +880,6 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
        int ssize;              /* source pathname size */
        struct btstack btstack;
        struct inode *ip = d_inode(dentry);
-       unchar *i_fastsymlink;
        s64 xlen = 0;
        int bmask = 0, xsize;
        s64 xaddr;
@@ -946,8 +945,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
        if (ssize <= IDATASIZE) {
                ip->i_op = &jfs_fast_symlink_inode_operations;
 
-               i_fastsymlink = JFS_IP(ip)->i_inline;
-               memcpy(i_fastsymlink, name, ssize);
+               ip->i_link = JFS_IP(ip)->i_inline;
+               memcpy(ip->i_link, name, ssize);
                ip->i_size = ssize - 1;
 
                /*
index 80f42bcc4ef1295669de10ea1087384f1c98c95b..5929e2363cb85eddc0d54bf3a04754383cb395db 100644 (file)
  */
 
 #include <linux/fs.h>
-#include <linux/namei.h>
 #include "jfs_incore.h"
 #include "jfs_inode.h"
 #include "jfs_xattr.h"
 
-static void *jfs_follow_link(struct dentry *dentry, struct nameidata *nd)
-{
-       char *s = JFS_IP(d_inode(dentry))->i_inline;
-       nd_set_link(nd, s);
-       return NULL;
-}
-
 const struct inode_operations jfs_fast_symlink_inode_operations = {
        .readlink       = generic_readlink,
-       .follow_link    = jfs_follow_link,
+       .follow_link    = simple_follow_link,
        .setattr        = jfs_setattr,
        .setxattr       = jfs_setxattr,
        .getxattr       = jfs_getxattr,