]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/cifs/dir.c
don't pass nameidata to ->create()
[mirror_ubuntu-bionic-kernel.git] / fs / cifs / dir.c
index c00c192f17e97b1a3822936dcd651d1c20e7d39a..a180265a10b56b5d4e98c63ff64e298f8146431f 100644 (file)
@@ -401,12 +401,11 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
         * in network traffic in the other paths.
         */
        if (!(oflags & O_CREAT)) {
-               struct dentry *res = cifs_lookup(inode, direntry, NULL);
+               struct dentry *res = cifs_lookup(inode, direntry, 0);
                if (IS_ERR(res))
                        return PTR_ERR(res);
 
-               finish_no_open(file, res);
-               return 1;
+               return finish_no_open(file, res);
        }
 
        rc = check_name(direntry);
@@ -452,7 +451,7 @@ free_xid:
 }
 
 int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
-               struct nameidata *nd)
+               bool excl)
 {
        int rc;
        int xid = GetXid();
@@ -622,7 +621,7 @@ mknod_out:
 
 struct dentry *
 cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
-           struct nameidata *nd)
+           unsigned int flags)
 {
        int xid;
        int rc = 0; /* to get around spurious gcc warning, set to zero here */
@@ -701,9 +700,9 @@ lookup_out:
 }
 
 static int
-cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
+cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
 {
-       if (nd && (nd->flags & LOOKUP_RCU))
+       if (flags & LOOKUP_RCU)
                return -ECHILD;
 
        if (direntry->d_inode) {
@@ -732,7 +731,7 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
         * This may be nfsd (or something), anyway, we can't see the
         * intent of this. So, since this can be for creation, drop it.
         */
-       if (!nd)
+       if (!flags)
                return 0;
 
        /*
@@ -740,7 +739,7 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
         * case sensitive name which is specified by user if this is
         * for creation.
         */
-       if (nd->flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET))
+       if (flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET))
                return 0;
 
        if (time_after(jiffies, direntry->d_time + HZ) || !lookupCacheEnabled)