Commit 4b8061a6 authored by Al Viro's avatar Al Viro

ufs: switch to simple_follow_link()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 5723cb01
......@@ -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;
}
......
......@@ -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);
......
......@@ -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,
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment