diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-11-15 18:24:17 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-06 20:43:26 -0500 |
commit | 9cdce3c074fbd7083923f15225e112a91daff8ed (patch) | |
tree | f1c4e23622a46b610f1f710c7c248b73ee7269b3 | |
parent | c73119c58fef2590e0a2bef959a12cff7a07874b (diff) |
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>
-rw-r--r-- | fs/ufs/Makefile | 2 | ||||
-rw-r--r-- | fs/ufs/inode.c | 4 | ||||
-rw-r--r-- | fs/ufs/namei.c | 4 | ||||
-rw-r--r-- | fs/ufs/symlink.c | 42 | ||||
-rw-r--r-- | fs/ufs/ufs.h | 4 |
5 files changed, 5 insertions, 51 deletions
diff --git a/fs/ufs/Makefile b/fs/ufs/Makefile index 392db25c0b56..ec4a6b49fa13 100644 --- a/fs/ufs/Makefile +++ b/fs/ufs/Makefile | |||
@@ -5,5 +5,5 @@ | |||
5 | obj-$(CONFIG_UFS_FS) += ufs.o | 5 | obj-$(CONFIG_UFS_FS) += ufs.o |
6 | 6 | ||
7 | ufs-objs := balloc.o cylinder.o dir.o file.o ialloc.o inode.o \ | 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 | ccflags-$(CONFIG_UFS_DEBUG) += -DDEBUG | 9 | ccflags-$(CONFIG_UFS_DEBUG) += -DDEBUG |
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index a064cf44b143..737160a7b819 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -528,11 +528,11 @@ static void ufs_set_inode_ops(struct inode *inode) | |||
528 | inode->i_mapping->a_ops = &ufs_aops; | 528 | inode->i_mapping->a_ops = &ufs_aops; |
529 | } else if (S_ISLNK(inode->i_mode)) { | 529 | } else if (S_ISLNK(inode->i_mode)) { |
530 | if (!inode->i_blocks) { | 530 | if (!inode->i_blocks) { |
531 | inode->i_op = &ufs_fast_symlink_inode_operations; | ||
532 | inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink; | 531 | inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink; |
532 | inode->i_op = &simple_symlink_inode_operations; | ||
533 | } else { | 533 | } else { |
534 | inode->i_op = &ufs_symlink_inode_operations; | ||
535 | inode->i_mapping->a_ops = &ufs_aops; | 534 | inode->i_mapping->a_ops = &ufs_aops; |
535 | inode->i_op = &page_symlink_inode_operations; | ||
536 | } | 536 | } |
537 | } else | 537 | } else |
538 | init_special_inode(inode, inode->i_mode, | 538 | init_special_inode(inode, inode->i_mode, |
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index 47966554317c..24b0cbd2d917 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c | |||
@@ -123,14 +123,14 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry, | |||
123 | 123 | ||
124 | if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) { | 124 | if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) { |
125 | /* slow symlink */ | 125 | /* slow symlink */ |
126 | inode->i_op = &ufs_symlink_inode_operations; | 126 | inode->i_op = &page_symlink_inode_operations; |
127 | inode->i_mapping->a_ops = &ufs_aops; | 127 | inode->i_mapping->a_ops = &ufs_aops; |
128 | err = page_symlink(inode, symname, l); | 128 | err = page_symlink(inode, symname, l); |
129 | if (err) | 129 | if (err) |
130 | goto out_fail; | 130 | goto out_fail; |
131 | } else { | 131 | } else { |
132 | /* fast symlink */ | 132 | /* fast symlink */ |
133 | inode->i_op = &ufs_fast_symlink_inode_operations; | 133 | inode->i_op = &simple_symlink_inode_operations; |
134 | inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink; | 134 | inode->i_link = (char *)UFS_I(inode)->i_u1.i_symlink; |
135 | memcpy(inode->i_link, symname, l); | 135 | memcpy(inode->i_link, symname, l); |
136 | inode->i_size = l-1; | 136 | inode->i_size = l-1; |
diff --git a/fs/ufs/symlink.c b/fs/ufs/symlink.c deleted file mode 100644 index 874480bb43e9..000000000000 --- a/fs/ufs/symlink.c +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
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 | }; | ||
diff --git a/fs/ufs/ufs.h b/fs/ufs/ufs.h index 7da4aca868c0..c87f4c3fa9dd 100644 --- a/fs/ufs/ufs.h +++ b/fs/ufs/ufs.h | |||
@@ -136,10 +136,6 @@ extern __printf(3, 4) | |||
136 | void ufs_panic(struct super_block *, const char *, const char *, ...); | 136 | void ufs_panic(struct super_block *, const char *, const char *, ...); |
137 | void ufs_mark_sb_dirty(struct super_block *sb); | 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 | static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) | 139 | static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) |
144 | { | 140 | { |
145 | return sb->s_fs_info; | 141 | return sb->s_fs_info; |