Skip to content

Commit

Permalink
ufs: get rid of ->setattr() for symlinks
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Al Viro committed Dec 7, 2015
1 parent c73119c commit 9cdce3c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 51 deletions.
2 changes: 1 addition & 1 deletion fs/ufs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
obj-$(CONFIG_UFS_FS) += ufs.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
4 changes: 2 additions & 2 deletions fs/ufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,11 +528,11 @@ static void ufs_set_inode_ops(struct inode *inode)
inode->i_mapping->a_ops = &ufs_aops;
} else if (S_ISLNK(inode->i_mode)) {
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_op = &simple_symlink_inode_operations;
} else {
inode->i_op = &ufs_symlink_inode_operations;
inode->i_mapping->a_ops = &ufs_aops;
inode->i_op = &page_symlink_inode_operations;
}
} else
init_special_inode(inode, inode->i_mode,
Expand Down
4 changes: 2 additions & 2 deletions fs/ufs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,

if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) {
/* slow symlink */
inode->i_op = &ufs_symlink_inode_operations;
inode->i_op = &page_symlink_inode_operations;
inode->i_mapping->a_ops = &ufs_aops;
err = page_symlink(inode, symname, l);
if (err)
goto out_fail;
} else {
/* 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;
memcpy(inode->i_link, symname, l);
inode->i_size = l-1;
Expand Down
42 changes: 0 additions & 42 deletions fs/ufs/symlink.c

This file was deleted.

4 changes: 0 additions & 4 deletions fs/ufs/ufs.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ extern __printf(3, 4)
void ufs_panic(struct super_block *, const char *, const char *, ...);
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)
{
return sb->s_fs_info;
Expand Down

0 comments on commit 9cdce3c

Please sign in to comment.