summaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-10 18:05:36 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:34:47 -0400
commitebfc3b49a7ac25920cb5be5445f602e51d2ea559 (patch)
treec3241f875dd04ab9f63b4e7ded7ed206e4df1b9f /fs/nfs/dir.c
parent72bd866a01fc62ccbc466f3eb7599b14c937e96b (diff)
don't pass nameidata to ->create()
boolean "does it have to be exclusive?" flag is passed instead; Local filesystem should just ignore it - the object is guaranteed not to be there yet. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 8f21205c5896..a6b1c7fb8232 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -47,7 +47,7 @@ static int nfs_opendir(struct inode *, struct file *);
47static int nfs_closedir(struct inode *, struct file *); 47static int nfs_closedir(struct inode *, struct file *);
48static int nfs_readdir(struct file *, void *, filldir_t); 48static int nfs_readdir(struct file *, void *, filldir_t);
49static struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int); 49static struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int);
50static int nfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *); 50static int nfs_create(struct inode *, struct dentry *, umode_t, bool);
51static int nfs_mkdir(struct inode *, struct dentry *, umode_t); 51static int nfs_mkdir(struct inode *, struct dentry *, umode_t);
52static int nfs_rmdir(struct inode *, struct dentry *); 52static int nfs_rmdir(struct inode *, struct dentry *);
53static int nfs_unlink(struct inode *, struct dentry *); 53static int nfs_unlink(struct inode *, struct dentry *);
@@ -1589,11 +1589,11 @@ out_error:
1589 * reply path made it appear to have failed. 1589 * reply path made it appear to have failed.
1590 */ 1590 */
1591static int nfs_create(struct inode *dir, struct dentry *dentry, 1591static int nfs_create(struct inode *dir, struct dentry *dentry,
1592 umode_t mode, struct nameidata *nd) 1592 umode_t mode, bool excl)
1593{ 1593{
1594 struct iattr attr; 1594 struct iattr attr;
1595 int open_flags = excl ? O_CREAT | O_EXCL : O_CREAT;
1595 int error; 1596 int error;
1596 int open_flags = O_CREAT|O_EXCL;
1597 1597
1598 dfprintk(VFS, "NFS: create(%s/%ld), %s\n", 1598 dfprintk(VFS, "NFS: create(%s/%ld), %s\n",
1599 dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); 1599 dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);
@@ -1601,9 +1601,6 @@ static int nfs_create(struct inode *dir, struct dentry *dentry,
1601 attr.ia_mode = mode; 1601 attr.ia_mode = mode;
1602 attr.ia_valid = ATTR_MODE; 1602 attr.ia_valid = ATTR_MODE;
1603 1603
1604 if (nd && !(nd->flags & LOOKUP_EXCL))
1605 open_flags = O_CREAT;
1606
1607 error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags); 1604 error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags);
1608 if (error != 0) 1605 if (error != 0)
1609 goto out_err; 1606 goto out_err;