ufs: switch to simple_follow_link()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
5723cb01f0
commit
4b8061a67f
|
@ -572,9 +572,10 @@ static void ufs_set_inode_ops(struct inode *inode)
|
||||||
inode->i_fop = &ufs_dir_operations;
|
inode->i_fop = &ufs_dir_operations;
|
||||||
inode->i_mapping->a_ops = &ufs_aops;
|
inode->i_mapping->a_ops = &ufs_aops;
|
||||||
} else if (S_ISLNK(inode->i_mode)) {
|
} else if (S_ISLNK(inode->i_mode)) {
|
||||||
if (!inode->i_blocks)
|
if (!inode->i_blocks) {
|
||||||
inode->i_op = &ufs_fast_symlink_inode_operations;
|
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_op = &ufs_symlink_inode_operations;
|
||||||
inode->i_mapping->a_ops = &ufs_aops;
|
inode->i_mapping->a_ops = &ufs_aops;
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,8 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
|
||||||
} else {
|
} else {
|
||||||
/* fast symlink */
|
/* fast symlink */
|
||||||
inode->i_op = &ufs_fast_symlink_inode_operations;
|
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;
|
inode->i_size = l-1;
|
||||||
}
|
}
|
||||||
mark_inode_dirty(inode);
|
mark_inode_dirty(inode);
|
||||||
|
|
|
@ -25,23 +25,12 @@
|
||||||
* ext2 symlink handling code
|
* ext2 symlink handling code
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/fs.h>
|
|
||||||
#include <linux/namei.h>
|
|
||||||
|
|
||||||
#include "ufs_fs.h"
|
#include "ufs_fs.h"
|
||||||
#include "ufs.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 = {
|
const struct inode_operations ufs_fast_symlink_inode_operations = {
|
||||||
.readlink = generic_readlink,
|
.readlink = generic_readlink,
|
||||||
.follow_link = ufs_follow_link,
|
.follow_link = simple_follow_link,
|
||||||
.setattr = ufs_setattr,
|
.setattr = ufs_setattr,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue