From: Al Viro <viro@ZenIV.linux.org.uk>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Neil Brown <neilb@suse.com>,
linux-fsdevel@vger.kernel.org
Subject: [PATCH v2 04/11] ufs: get rid of ->setattr() for symlinks
Date: Wed, 9 Dec 2015 05:34:48 +0000 [thread overview]
Message-ID: <1449639295-20512-4-git-send-email-viro@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20151209053209.GV20997@ZenIV.linux.org.uk>
From: Al Viro <viro@zeniv.linux.org.uk>
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>
---
fs/ufs/Makefile | 2 +-
fs/ufs/inode.c | 4 ++--
fs/ufs/namei.c | 4 ++--
fs/ufs/symlink.c | 42 ------------------------------------------
fs/ufs/ufs.h | 4 ----
5 files changed, 5 insertions(+), 51 deletions(-)
delete mode 100644 fs/ufs/symlink.c
diff --git a/fs/ufs/Makefile b/fs/ufs/Makefile
index 392db25..ec4a6b4 100644
--- a/fs/ufs/Makefile
+++ b/fs/ufs/Makefile
@@ -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
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index a064cf44..737160a 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -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,
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c
index 4796655..24b0cbd 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,
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;
diff --git a/fs/ufs/symlink.c b/fs/ufs/symlink.c
deleted file mode 100644
index 874480b..0000000
--- a/fs/ufs/symlink.c
+++ /dev/null
@@ -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,
-};
diff --git a/fs/ufs/ufs.h b/fs/ufs/ufs.h
index 7da4aca..c87f4c3 100644
--- a/fs/ufs/ufs.h
+++ b/fs/ufs/ufs.h
@@ -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;
--
2.1.4
next prev parent reply other threads:[~2015-12-09 5:34 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 22:57 [PATCHSET] ->follow_link() without dropping from RCU mode Al Viro
2015-11-17 23:00 ` [PATCH 01/10] switch befs long symlinks to page_symlink_operations Al Viro
2015-11-17 23:00 ` [PATCH 02/10] logfs: don't duplicate page_symlink_inode_operations Al Viro
2015-11-17 23:00 ` [PATCH 03/10] udf: " Al Viro
2015-11-17 23:00 ` [PATCH 04/10] ufs: get rid of ->setattr() for symlinks Al Viro
2015-11-17 23:00 ` [PATCH 05/10] namei: page_getlink() and page_follow_link_light() are the same thing Al Viro
2015-11-17 23:00 ` [PATCH 06/10] [vfs] don't put symlink bodies in pagecache into highmem Al Viro
2015-11-19 23:02 ` Dave Chinner
2015-11-17 23:00 ` [PATCH 07/10] [vfs] replace ->follow_link() with new method that could stay in RCU mode Al Viro
2015-11-17 23:00 ` [PATCH 08/10] teach page_get_link() to work " Al Viro
2015-11-17 23:00 ` [PATCH 09/10] teach shmem_get_link() " Al Viro
2015-11-17 23:00 ` [PATCH 10/10] teach proc_self_get_link()/proc_thread_self_get_link() " Al Viro
2015-12-09 5:32 ` [PATCHSET v2] ->follow_link() without dropping from " Al Viro
2015-12-09 5:34 ` [PATCH v2 01/11] switch befs long symlinks to page_symlink_operations Al Viro
2015-12-09 5:34 ` [PATCH v2 02/11] logfs: don't duplicate page_symlink_inode_operations Al Viro
2015-12-09 5:34 ` [PATCH v2 03/11] udf: " Al Viro
2015-12-09 5:34 ` Al Viro [this message]
2015-12-09 5:34 ` [PATCH v2 05/11] namei: page_getlink() and page_follow_link_light() are the same thing Al Viro
2015-12-09 5:34 ` [PATCH v2 06/11] don't put symlink bodies in pagecache into highmem Al Viro
2016-01-14 13:22 ` Tomeu Vizoso
2016-01-14 15:25 ` Al Viro
2016-01-14 15:58 ` Tomeu Vizoso
2016-01-14 16:23 ` Al Viro
2016-01-14 16:57 ` Tomeu Vizoso
2016-01-14 17:13 ` Al Viro
2016-01-14 19:15 ` Tomeu Vizoso
2016-01-14 21:02 ` Al Viro
2016-01-14 21:40 ` Linus Torvalds
2016-01-14 22:25 ` Al Viro
2016-01-14 23:33 ` Al Viro
2016-01-14 23:58 ` Linus Torvalds
2016-01-15 0:05 ` Al Viro
2015-12-09 5:34 ` [PATCH v2 07/11] replace ->follow_link() with new method that could stay in RCU mode Al Viro
2015-12-09 5:34 ` [PATCH v2 08/11] teach page_get_link() to work " Al Viro
2015-12-09 5:34 ` [PATCH v2 09/11] teach shmem_get_link() " Al Viro
2015-12-09 5:34 ` [PATCH v2 10/11] teach proc_self_get_link()/proc_thread_self_get_link() " Al Viro
2015-12-09 5:34 ` [PATCH v2 11/11] teach nfs_get_link() " Al Viro
2015-12-09 17:24 ` [PATCHSET v2] ->follow_link() without dropping from " Linus Torvalds
2015-12-09 18:23 ` Al Viro
2015-12-10 0:10 ` Al Viro
2015-12-10 2:40 ` Al Viro
2015-12-11 1:54 ` Al Viro
2015-12-11 7:49 ` Rasmus Villemoes
2015-12-11 23:16 ` Al Viro
2015-12-12 2:00 ` Al Viro
2015-12-13 18:43 ` Rasmus Villemoes
2015-12-13 3:47 ` Al Viro
2015-12-09 21:57 ` NeilBrown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1449639295-20512-4-git-send-email-viro@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).