Commit 312b63fba9e88a0dcf800834b8ede8716bcc1e17
1 parent
ebfc3b49a7
Exists in
master
and in
20 other branches
don't pass nameidata * to vfs_create()
all we want is a boolean flag, same as the method gets now Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 6 changed files with 11 additions and 10 deletions Side-by-side Diff
fs/cachefiles/namei.c
... | ... | @@ -567,7 +567,7 @@ |
567 | 567 | if (ret < 0) |
568 | 568 | goto create_error; |
569 | 569 | start = jiffies; |
570 | - ret = vfs_create(dir->d_inode, next, S_IFREG, NULL); | |
570 | + ret = vfs_create(dir->d_inode, next, S_IFREG, true); | |
571 | 571 | cachefiles_hist(cachefiles_create_histogram, start); |
572 | 572 | if (ret < 0) |
573 | 573 | goto create_error; |
fs/ecryptfs/inode.c
... | ... | @@ -173,7 +173,7 @@ |
173 | 173 | inode = ERR_CAST(lower_dir_dentry); |
174 | 174 | goto out; |
175 | 175 | } |
176 | - rc = vfs_create(lower_dir_dentry->d_inode, lower_dentry, mode, NULL); | |
176 | + rc = vfs_create(lower_dir_dentry->d_inode, lower_dentry, mode, true); | |
177 | 177 | if (rc) { |
178 | 178 | printk(KERN_ERR "%s: Failure to create dentry in lower fs; " |
179 | 179 | "rc = [%d]\n", __func__, rc); |
fs/namei.c
... | ... | @@ -2079,7 +2079,7 @@ |
2079 | 2079 | } |
2080 | 2080 | |
2081 | 2081 | int vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, |
2082 | - struct nameidata *nd) | |
2082 | + bool want_excl) | |
2083 | 2083 | { |
2084 | 2084 | int error = may_create(dir, dentry); |
2085 | 2085 | if (error) |
... | ... | @@ -2092,7 +2092,7 @@ |
2092 | 2092 | error = security_inode_create(dir, dentry, mode); |
2093 | 2093 | if (error) |
2094 | 2094 | return error; |
2095 | - error = dir->i_op->create(dir, dentry, mode, !nd || (nd->flags & LOOKUP_EXCL)); | |
2095 | + error = dir->i_op->create(dir, dentry, mode, want_excl); | |
2096 | 2096 | if (!error) |
2097 | 2097 | fsnotify_create(dir, dentry); |
2098 | 2098 | return error; |
... | ... | @@ -2396,7 +2396,8 @@ |
2396 | 2396 | error = security_path_mknod(&nd->path, dentry, mode, 0); |
2397 | 2397 | if (error) |
2398 | 2398 | goto out_dput; |
2399 | - error = vfs_create(dir->d_inode, dentry, mode, nd); | |
2399 | + error = vfs_create(dir->d_inode, dentry, mode, | |
2400 | + nd->flags & LOOKUP_EXCL); | |
2400 | 2401 | if (error) |
2401 | 2402 | goto out_dput; |
2402 | 2403 | } |
... | ... | @@ -2883,7 +2884,7 @@ |
2883 | 2884 | goto out_drop_write; |
2884 | 2885 | switch (mode & S_IFMT) { |
2885 | 2886 | case 0: case S_IFREG: |
2886 | - error = vfs_create(path.dentry->d_inode,dentry,mode,NULL); | |
2887 | + error = vfs_create(path.dentry->d_inode,dentry,mode,true); | |
2887 | 2888 | break; |
2888 | 2889 | case S_IFCHR: case S_IFBLK: |
2889 | 2890 | error = vfs_mknod(path.dentry->d_inode,dentry,mode, |
fs/nfsd/vfs.c
... | ... | @@ -1329,7 +1329,7 @@ |
1329 | 1329 | err = 0; |
1330 | 1330 | switch (type) { |
1331 | 1331 | case S_IFREG: |
1332 | - host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL); | |
1332 | + host_err = vfs_create(dirp, dchild, iap->ia_mode, true); | |
1333 | 1333 | if (!host_err) |
1334 | 1334 | nfsd_check_ignore_resizing(iap); |
1335 | 1335 | break; |
... | ... | @@ -1492,7 +1492,7 @@ |
1492 | 1492 | goto out; |
1493 | 1493 | } |
1494 | 1494 | |
1495 | - host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL); | |
1495 | + host_err = vfs_create(dirp, dchild, iap->ia_mode, true); | |
1496 | 1496 | if (host_err < 0) { |
1497 | 1497 | fh_drop_write(fhp); |
1498 | 1498 | goto out_nfserr; |
include/linux/fs.h
... | ... | @@ -1571,7 +1571,7 @@ |
1571 | 1571 | /* |
1572 | 1572 | * VFS helper functions.. |
1573 | 1573 | */ |
1574 | -extern int vfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *); | |
1574 | +extern int vfs_create(struct inode *, struct dentry *, umode_t, bool); | |
1575 | 1575 | extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); |
1576 | 1576 | extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); |
1577 | 1577 | extern int vfs_symlink(struct inode *, struct dentry *, const char *); |
ipc/mqueue.c
... | ... | @@ -751,7 +751,7 @@ |
751 | 751 | ret = mnt_want_write(ipc_ns->mq_mnt); |
752 | 752 | if (ret) |
753 | 753 | goto out; |
754 | - ret = vfs_create(dir->d_inode, dentry, mode, NULL); | |
754 | + ret = vfs_create(dir->d_inode, dentry, mode, true); | |
755 | 755 | dentry->d_fsdata = NULL; |
756 | 756 | if (ret) |
757 | 757 | goto out_drop_write; |