Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

Al Viro 9cdce3c0 c73119c5

+5 -51
+1 -1
fs/ufs/Makefile
··· 5 5 obj-$(CONFIG_UFS_FS) += ufs.o 6 6 7 7 ufs-objs := balloc.o cylinder.o dir.o file.o ialloc.o inode.o \ 8 - namei.o super.o symlink.o util.o 8 + namei.o super.o util.o 9 9 ccflags-$(CONFIG_UFS_DEBUG) += -DDEBUG
+2 -2
fs/ufs/inode.c
··· 528 528 inode->i_mapping->a_ops = &ufs_aops; 529 529 } else if (S_ISLNK(inode->i_mode)) { 530 530 if (!inode->i_blocks) { 531 - inode->i_op = &ufs_fast_symlink_inode_operations; 532 531 inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink; 532 + inode->i_op = &simple_symlink_inode_operations; 533 533 } else { 534 - inode->i_op = &ufs_symlink_inode_operations; 535 534 inode->i_mapping->a_ops = &ufs_aops; 535 + inode->i_op = &page_symlink_inode_operations; 536 536 } 537 537 } else 538 538 init_special_inode(inode, inode->i_mode,
+2 -2
fs/ufs/namei.c
··· 123 123 124 124 if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) { 125 125 /* slow symlink */ 126 - inode->i_op = &ufs_symlink_inode_operations; 126 + inode->i_op = &page_symlink_inode_operations; 127 127 inode->i_mapping->a_ops = &ufs_aops; 128 128 err = page_symlink(inode, symname, l); 129 129 if (err) 130 130 goto out_fail; 131 131 } else { 132 132 /* fast symlink */ 133 - inode->i_op = &ufs_fast_symlink_inode_operations; 133 + inode->i_op = &simple_symlink_inode_operations; 134 134 inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink; 135 135 memcpy(inode->i_link, symname, l); 136 136 inode->i_size = l-1;
-42
fs/ufs/symlink.c
··· 1 - /* 2 - * linux/fs/ufs/symlink.c 3 - * 4 - * Only fast symlinks left here - the rest is done by generic code. AV, 1999 5 - * 6 - * Copyright (C) 1998 7 - * Daniel Pirkl <daniel.pirkl@emai.cz> 8 - * Charles University, Faculty of Mathematics and Physics 9 - * 10 - * from 11 - * 12 - * linux/fs/ext2/symlink.c 13 - * 14 - * Copyright (C) 1992, 1993, 1994, 1995 15 - * Remy Card (card@masi.ibp.fr) 16 - * Laboratoire MASI - Institut Blaise Pascal 17 - * Universite Pierre et Marie Curie (Paris VI) 18 - * 19 - * from 20 - * 21 - * linux/fs/minix/symlink.c 22 - * 23 - * Copyright (C) 1991, 1992 Linus Torvalds 24 - * 25 - * ext2 symlink handling code 26 - */ 27 - 28 - #include "ufs_fs.h" 29 - #include "ufs.h" 30 - 31 - const struct inode_operations ufs_fast_symlink_inode_operations = { 32 - .readlink = generic_readlink, 33 - .follow_link = simple_follow_link, 34 - .setattr = ufs_setattr, 35 - }; 36 - 37 - const struct inode_operations ufs_symlink_inode_operations = { 38 - .readlink = generic_readlink, 39 - .follow_link = page_follow_link_light, 40 - .put_link = page_put_link, 41 - .setattr = ufs_setattr, 42 - };
-4
fs/ufs/ufs.h
··· 136 136 void ufs_panic(struct super_block *, const char *, const char *, ...); 137 137 void ufs_mark_sb_dirty(struct super_block *sb); 138 138 139 - /* symlink.c */ 140 - extern const struct inode_operations ufs_fast_symlink_inode_operations; 141 - extern const struct inode_operations ufs_symlink_inode_operations; 142 - 143 139 static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) 144 140 { 145 141 return sb->s_fs_info;