Skip to content

Commit

Permalink
ufs: switch to simple_follow_link()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 11, 2015
1 parent 5723cb0 commit 4b8061a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
5 changes: 3 additions & 2 deletions fs/ufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,10 @@ static void ufs_set_inode_ops(struct inode *inode)
inode->i_fop = &ufs_dir_operations;
inode->i_mapping->a_ops = &ufs_aops;
} else if (S_ISLNK(inode->i_mode)) {
if (!inode->i_blocks)
if (!inode->i_blocks) {
inode->i_op = &ufs_fast_symlink_inode_operations;
else {
inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink;
} else {
inode->i_op = &ufs_symlink_inode_operations;
inode->i_mapping->a_ops = &ufs_aops;
}
Expand Down
3 changes: 2 additions & 1 deletion fs/ufs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
} else {
/* fast symlink */
inode->i_op = &ufs_fast_symlink_inode_operations;
memcpy(UFS_I(inode)->i_u1.i_symlink, symname, l);
inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink;
memcpy(inode->i_link, symname, l);
inode->i_size = l-1;
}
mark_inode_dirty(inode);
Expand Down
13 changes: 1 addition & 12 deletions fs/ufs/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,12 @@
* ext2 symlink handling code
*/

#include <linux/fs.h>
#include <linux/namei.h>

#include "ufs_fs.h"
#include "ufs.h"


static void *ufs_follow_link(struct dentry *dentry, struct nameidata *nd)
{
struct ufs_inode_info *p = UFS_I(d_inode(dentry));
nd_set_link(nd, (char*)p->i_u1.i_symlink);
return NULL;
}

const struct inode_operations ufs_fast_symlink_inode_operations = {
.readlink = generic_readlink,
.follow_link = ufs_follow_link,
.follow_link = simple_follow_link,
.setattr = ufs_setattr,
};

Expand Down

0 comments on commit 4b8061a

Please sign in to comment.