don't pass nameidata * to vfs_create()

all we want is a boolean flag, same as the method gets now

Change-Id: I0cbe220b96bbbec6d50228cac774a0439f6a29f2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2012-06-10 18:09:36 -04:00 committed by Artem Borisov
parent dcb9cda2ea
commit 2023b60cc3
6 changed files with 14 additions and 13 deletions

View file

@ -567,7 +567,7 @@ lookup_again:
if (ret < 0) if (ret < 0)
goto create_error; goto create_error;
start = jiffies; start = jiffies;
ret = vfs_create(dir->d_inode, next, S_IFREG, NULL); ret = vfs_create(dir->d_inode, next, S_IFREG, true);
cachefiles_hist(cachefiles_create_histogram, start); cachefiles_hist(cachefiles_create_histogram, start);
if (ret < 0) if (ret < 0)
goto create_error; goto create_error;

View file

@ -198,7 +198,7 @@ ecryptfs_do_create(struct inode *directory_inode,
inode = ERR_CAST(lower_dir_dentry); inode = ERR_CAST(lower_dir_dentry);
goto out; goto out;
} }
rc = vfs_create(lower_dir_dentry->d_inode, lower_dentry, mode, NULL); rc = vfs_create(lower_dir_dentry->d_inode, lower_dentry, mode, true);
if (rc) { if (rc) {
printk(KERN_ERR "%s: Failure to create dentry in lower fs; " printk(KERN_ERR "%s: Failure to create dentry in lower fs; "
"rc = [%d]\n", __func__, rc); "rc = [%d]\n", __func__, rc);

View file

@ -2169,7 +2169,7 @@ void unlock_rename(struct dentry *p1, struct dentry *p2)
} }
int vfs_create2(struct vfsmount *mnt, struct inode *dir, struct dentry *dentry, int vfs_create2(struct vfsmount *mnt, struct inode *dir, struct dentry *dentry,
umode_t mode, struct nameidata *nd) umode_t mode, bool want_excl)
{ {
int error = may_create(mnt, dir, dentry); int error = may_create(mnt, dir, dentry);
if (error) if (error)
@ -2182,7 +2182,7 @@ int vfs_create2(struct vfsmount *mnt, struct inode *dir, struct dentry *dentry,
error = security_inode_create(dir, dentry, mode); error = security_inode_create(dir, dentry, mode);
if (error) if (error)
return error; return error;
error = dir->i_op->create(dir, dentry, mode, !nd || (nd->flags & LOOKUP_EXCL)); error = dir->i_op->create(dir, dentry, mode, want_excl);
if (!error) if (!error)
fsnotify_create(dir, dentry); fsnotify_create(dir, dentry);
return error; return error;
@ -2190,9 +2190,9 @@ int vfs_create2(struct vfsmount *mnt, struct inode *dir, struct dentry *dentry,
EXPORT_SYMBOL(vfs_create2); EXPORT_SYMBOL(vfs_create2);
int vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, int vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
struct nameidata *nd) bool want_excl)
{ {
return vfs_create2(NULL, dir, dentry, mode, nd); return vfs_create2(NULL, dir, dentry, mode, want_excl);
} }
EXPORT_SYMBOL(vfs_create); EXPORT_SYMBOL(vfs_create);
@ -2496,7 +2496,8 @@ static int lookup_open(struct nameidata *nd, struct path *path,
error = security_path_mknod(&nd->path, dentry, mode, 0); error = security_path_mknod(&nd->path, dentry, mode, 0);
if (error) if (error)
goto out_dput; goto out_dput;
error = vfs_create2(mnt, dir->d_inode, dentry, mode, nd); error = vfs_create2(mnt, dir->d_inode, dentry, mode,
nd->flags & LOOKUP_EXCL);
if (error) if (error)
goto out_dput; goto out_dput;
} }
@ -2990,7 +2991,7 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
goto out_drop_write; goto out_drop_write;
switch (mode & S_IFMT) { switch (mode & S_IFMT) {
case 0: case S_IFREG: case 0: case S_IFREG:
error = vfs_create2(path.mnt, path.dentry->d_inode,dentry,mode,NULL); error = vfs_create2(path.mnt, path.dentry->d_inode,dentry,mode,true);
break; break;
case S_IFCHR: case S_IFBLK: case S_IFCHR: case S_IFBLK:
error = vfs_mknod2(path.mnt, path.dentry->d_inode,dentry,mode, error = vfs_mknod2(path.mnt, path.dentry->d_inode,dentry,mode,

View file

@ -1367,7 +1367,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
err = 0; err = 0;
switch (type) { switch (type) {
case S_IFREG: case S_IFREG:
host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL); host_err = vfs_create(dirp, dchild, iap->ia_mode, true);
if (!host_err) if (!host_err)
nfsd_check_ignore_resizing(iap); nfsd_check_ignore_resizing(iap);
break; break;
@ -1536,7 +1536,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
goto out; goto out;
} }
host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL); host_err = vfs_create(dirp, dchild, iap->ia_mode, true);
if (host_err < 0) { if (host_err < 0) {
fh_drop_write(fhp); fh_drop_write(fhp);
goto out_nfserr; goto out_nfserr;

View file

@ -1578,8 +1578,8 @@ extern void unlock_super(struct super_block *);
/* /*
* VFS helper functions.. * VFS helper functions..
*/ */
extern int vfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *); extern int vfs_create(struct inode *, struct dentry *, umode_t, bool);
extern int vfs_create2(struct vfsmount *, struct inode *, struct dentry *, umode_t, struct nameidata *); extern int vfs_create2(struct vfsmount *, struct inode *, struct dentry *, umode_t, bool);
extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); extern int vfs_mkdir(struct inode *, struct dentry *, umode_t);
extern int vfs_mkdir2(struct vfsmount *, struct inode *, struct dentry *, umode_t); extern int vfs_mkdir2(struct vfsmount *, struct inode *, struct dentry *, umode_t);
extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t);

View file

@ -624,7 +624,7 @@ static struct file *do_create(struct ipc_namespace *ipc_ns, struct dentry *dir,
ret = mnt_want_write(ipc_ns->mq_mnt); ret = mnt_want_write(ipc_ns->mq_mnt);
if (ret) if (ret)
goto out; goto out;
ret = vfs_create2(ipc_ns->mq_mnt, dir->d_inode, dentry, mode, NULL); ret = vfs_create2(ipc_ns->mq_mnt, dir->d_inode, dentry, mode, true);
dentry->d_fsdata = NULL; dentry->d_fsdata = NULL;
if (ret) if (ret)
goto out_drop_write; goto out_drop_write;