From: Miklos Szeredi <miklos@szeredi.hu>
To: viro@ZenIV.linux.org.uk
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
hch@infradead.org, akpm@linux-foundation.org,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Subject: [patch 5/5] vfs: remove mode parameter from vfs_symlink()
Date: Tue, 24 Jun 2008 16:50:16 +0200 [thread overview]
Message-ID: <20080624145048.367596617@szeredi.hu> (raw)
In-Reply-To: <20080624145011.722691277@szeredi.hu>
[-- Attachment #1: vfs-remove-mode-parameter-from-path_symlink.patch --]
[-- Type: text/plain, Size: 4548 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
Remove the unused mode parameter from vfs_symlink and callers.
Thanks to Tetsuo Handa for noticing.
CC: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
fs/ecryptfs/inode.c | 4 +---
fs/namei.c | 4 ++--
fs/nfsd/vfs.c | 10 ++--------
include/linux/fs.h | 2 +-
4 files changed, 6 insertions(+), 14 deletions(-)
Index: linux-2.6/fs/ecryptfs/inode.c
===================================================================
--- linux-2.6.orig/fs/ecryptfs/inode.c 2008-06-19 14:58:09.000000000 +0200
+++ linux-2.6/fs/ecryptfs/inode.c 2008-06-24 16:26:14.000000000 +0200
@@ -444,7 +444,6 @@ static int ecryptfs_symlink(struct inode
int rc;
struct dentry *lower_dentry;
struct dentry *lower_dir_dentry;
- umode_t mode;
char *encoded_symname;
int encoded_symlen;
struct ecryptfs_crypt_stat *crypt_stat = NULL;
@@ -452,7 +451,6 @@ static int ecryptfs_symlink(struct inode
lower_dentry = ecryptfs_dentry_to_lower(dentry);
dget(lower_dentry);
lower_dir_dentry = lock_parent(lower_dentry);
- mode = S_IALLUGO;
encoded_symlen = ecryptfs_encode_filename(crypt_stat, symname,
strlen(symname),
&encoded_symname);
@@ -461,7 +459,7 @@ static int ecryptfs_symlink(struct inode
goto out_lock;
}
rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry,
- encoded_symname, mode);
+ encoded_symname);
kfree(encoded_symname);
if (rc || !lower_dentry->d_inode)
goto out_lock;
Index: linux-2.6/fs/namei.c
===================================================================
--- linux-2.6.orig/fs/namei.c 2008-06-24 16:26:00.000000000 +0200
+++ linux-2.6/fs/namei.c 2008-06-24 16:26:14.000000000 +0200
@@ -2408,7 +2408,7 @@ asmlinkage long sys_unlink(const char __
return do_unlinkat(AT_FDCWD, pathname);
}
-int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname, int mode)
+int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
{
int error = may_create(dir, dentry, NULL);
@@ -2457,7 +2457,7 @@ asmlinkage long sys_symlinkat(const char
error = mnt_want_write(nd.path.mnt);
if (error)
goto out_dput;
- error = vfs_symlink(nd.path.dentry->d_inode, dentry, from, S_IALLUGO);
+ error = vfs_symlink(nd.path.dentry->d_inode, dentry, from);
mnt_drop_write(nd.path.mnt);
out_dput:
dput(dentry);
Index: linux-2.6/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.orig/fs/nfsd/vfs.c 2008-06-24 13:58:36.000000000 +0200
+++ linux-2.6/fs/nfsd/vfs.c 2008-06-24 16:26:14.000000000 +0200
@@ -1517,7 +1517,6 @@ nfsd_symlink(struct svc_rqst *rqstp, str
struct dentry *dentry, *dnew;
__be32 err, cerr;
int host_err;
- umode_t mode;
err = nfserr_noent;
if (!flen || !plen)
@@ -1536,11 +1535,6 @@ nfsd_symlink(struct svc_rqst *rqstp, str
if (IS_ERR(dnew))
goto out_nfserr;
- mode = S_IALLUGO;
- /* Only the MODE ATTRibute is even vaguely meaningful */
- if (iap && (iap->ia_valid & ATTR_MODE))
- mode = iap->ia_mode & S_IALLUGO;
-
host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
if (host_err)
goto out_nfserr;
@@ -1552,11 +1546,11 @@ nfsd_symlink(struct svc_rqst *rqstp, str
else {
strncpy(path_alloced, path, plen);
path_alloced[plen] = 0;
- host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced, mode);
+ host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced);
kfree(path_alloced);
}
} else
- host_err = vfs_symlink(dentry->d_inode, dnew, path, mode);
+ host_err = vfs_symlink(dentry->d_inode, dnew, path);
if (!host_err) {
if (EX_ISSYNC(fhp->fh_export))
Index: linux-2.6/include/linux/fs.h
===================================================================
--- linux-2.6.orig/include/linux/fs.h 2008-06-24 16:25:25.000000000 +0200
+++ linux-2.6/include/linux/fs.h 2008-06-24 16:26:14.000000000 +0200
@@ -1125,7 +1125,7 @@ extern int vfs_permission(struct nameida
extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
extern int vfs_mkdir(struct inode *, struct dentry *, int);
extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
-extern int vfs_symlink(struct inode *, struct dentry *, const char *, int);
+extern int vfs_symlink(struct inode *, struct dentry *, const char *);
extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
extern int vfs_rmdir(struct inode *, struct dentry *);
extern int vfs_unlink(struct inode *, struct dentry *);
--
prev parent reply other threads:[~2008-06-24 14:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-24 14:50 [patch 0/5] vfs: cleanups Miklos Szeredi
2008-06-24 14:50 ` [patch 1/5] vfs: truncate: dont check immutable twice Miklos Szeredi
2008-06-24 14:50 ` [patch 2/5] vfs: create file_truncate() helper Miklos Szeredi
2008-06-24 14:50 ` [patch 3/5] vfs: change remove_suid() to file_remove_suid() Miklos Szeredi
2008-06-24 14:50 ` [patch 4/5] vfs: reuse local variable in vfs_link() Miklos Szeredi
2008-06-24 14:50 ` Miklos Szeredi [this message]
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=20080624145048.367596617@szeredi.hu \
--to=miklos@szeredi.hu \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=viro@ZenIV.linux.org.uk \
/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
all inboxes | Powered by JetHome®