]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/nfs/dir.c
vfs: Lazily remove mounts on unlinked files and directories. v2
[karo-tx-linux.git] / fs / nfs / dir.c
index de434f309af037c5196335d41666312a69bc50a7..e8e35acd88500949857e10a495db27820445326f 100644 (file)
@@ -1142,10 +1142,7 @@ out_zap_parent:
                if (dentry->d_flags & DCACHE_DISCONNECTED)
                        goto out_valid;
        }
-       /* If we have submounts, don't unhash ! */
-       if (check_submounts_and_drop(dentry) != 0)
-               goto out_valid;
-
+       shrink_submounts_and_drop(dentry);
        dput(parent);
        dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is invalid\n",
                        __func__, dentry->d_parent->d_name.name,
@@ -1392,6 +1389,9 @@ static int nfs_finish_open(struct nfs_open_context *ctx,
 {
        int err;
 
+       if ((open_flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
+               *opened |= FILE_CREATED;
+
        err = finish_open(file, dentry, do_open, opened);
        if (err)
                goto out;