ufs: get rid of ->setattr() for symlinks

It was to needed for a couple of months in 2010, until UFS
quota support got dropped.  Since then it's equivalent to
simple_setattr() (i.e. the default) for everything except the
regular files.  And dropping it there allows to convert all
UFS symlinks to {page,simple}_symlink_inode_operations, getting
rid of fs/ufs/symlink.c completely.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2015-11-15 18:24:17 -05:00
parent c73119c58f
commit 9cdce3c074
5 changed files with 5 additions and 51 deletions

View File

@ -5,5 +5,5 @@
obj-$(CONFIG_UFS_FS) += ufs.o obj-$(CONFIG_UFS_FS) += ufs.o
ufs-objs := balloc.o cylinder.o dir.o file.o ialloc.o inode.o \ ufs-objs := balloc.o cylinder.o dir.o file.o ialloc.o inode.o \
namei.o super.o symlink.o util.o namei.o super.o util.o
ccflags-$(CONFIG_UFS_DEBUG) += -DDEBUG ccflags-$(CONFIG_UFS_DEBUG) += -DDEBUG

View File

@ -528,11 +528,11 @@ static void ufs_set_inode_ops(struct inode *inode)
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_link = (char *)UFS_I(inode)->i_u1.i_symlink; inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink;
inode->i_op = &simple_symlink_inode_operations;
} else { } else {
inode->i_op = &ufs_symlink_inode_operations;
inode->i_mapping->a_ops = &ufs_aops; inode->i_mapping->a_ops = &ufs_aops;
inode->i_op = &page_symlink_inode_operations;
} }
} else } else
init_special_inode(inode, inode->i_mode, init_special_inode(inode, inode->i_mode,

View File

@ -123,14 +123,14 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) { if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) {
/* slow symlink */ /* slow symlink */
inode->i_op = &ufs_symlink_inode_operations; inode->i_op = &page_symlink_inode_operations;
inode->i_mapping->a_ops = &ufs_aops; inode->i_mapping->a_ops = &ufs_aops;
err = page_symlink(inode, symname, l); err = page_symlink(inode, symname, l);
if (err) if (err)
goto out_fail; goto out_fail;
} else { } else {
/* fast symlink */ /* fast symlink */
inode->i_op = &ufs_fast_symlink_inode_operations; inode->i_op = &simple_symlink_inode_operations;
inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink; inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink;
memcpy(inode->i_link, symname, l); memcpy(inode->i_link, symname, l);
inode->i_size = l-1; inode->i_size = l-1;

View File

@ -1,42 +0,0 @@
/*
* linux/fs/ufs/symlink.c
*
* Only fast symlinks left here - the rest is done by generic code. AV, 1999
*
* Copyright (C) 1998
* Daniel Pirkl <daniel.pirkl@emai.cz>
* Charles University, Faculty of Mathematics and Physics
*
* from
*
* linux/fs/ext2/symlink.c
*
* Copyright (C) 1992, 1993, 1994, 1995
* Remy Card (card@masi.ibp.fr)
* Laboratoire MASI - Institut Blaise Pascal
* Universite Pierre et Marie Curie (Paris VI)
*
* from
*
* linux/fs/minix/symlink.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*
* ext2 symlink handling code
*/
#include "ufs_fs.h"
#include "ufs.h"
const struct inode_operations ufs_fast_symlink_inode_operations = {
.readlink = generic_readlink,
.follow_link = simple_follow_link,
.setattr = ufs_setattr,
};
const struct inode_operations ufs_symlink_inode_operations = {
.readlink = generic_readlink,
.follow_link = page_follow_link_light,
.put_link = page_put_link,
.setattr = ufs_setattr,
};

View File

@ -136,10 +136,6 @@ extern __printf(3, 4)
void ufs_panic(struct super_block *, const char *, const char *, ...); void ufs_panic(struct super_block *, const char *, const char *, ...);
void ufs_mark_sb_dirty(struct super_block *sb); void ufs_mark_sb_dirty(struct super_block *sb);
/* symlink.c */
extern const struct inode_operations ufs_fast_symlink_inode_operations;
extern const struct inode_operations ufs_symlink_inode_operations;
static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) static inline struct ufs_sb_info *UFS_SB(struct super_block *sb)
{ {
return sb->s_fs_info; return sb->s_fs_info;