]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
vfs: Remove d_drop calls from d_revalidate implementations
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 13 Feb 2014 18:19:10 +0000 (10:19 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 25 Feb 2014 03:48:40 +0000 (19:48 -0800)
Now that d_invalidate always succeeds it is not longer necessary or
desirable to hard code d_drop calls into filesystem specific
d_revalidate implementations.

Remove the unnecessary d_drop calls and rely on d_invalidate
to drop the dentries.  Using d_invalidate ensures that paths
to mount points will not be dropped.

Reviewed-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/ceph/dir.c
fs/proc/base.c
fs/proc/fd.c

index 6da4df84ba300824a8a6afdea9f2a20121600765..ecd2402739e2128a7b65b090975fe9fd98ec23ca 100644 (file)
@@ -1052,7 +1052,6 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags)
                ceph_dentry_lru_touch(dentry);
        } else {
                ceph_dir_clear_complete(dir);
-               d_drop(dentry);
        }
        iput(dir);
        return valid;
index 51507065263b29e3b915a6aa2238630fe3f7ac67..aa62b37f130347031dae38c603b812ff91dcd878 100644 (file)
@@ -1654,7 +1654,6 @@ int pid_revalidate(struct dentry *dentry, unsigned int flags)
                put_task_struct(task);
                return 1;
        }
-       d_drop(dentry);
        return 0;
 }
 
@@ -1791,9 +1790,6 @@ out:
        put_task_struct(task);
 
 out_notask:
-       if (status <= 0)
-               d_drop(dentry);
-
        return status;
 }
 
index 985ea881b5bc489aa7ae0657e23fbe23d650d844..7e4f04ccab31b6cedc70a8281e9b676b88902012 100644 (file)
@@ -127,8 +127,6 @@ static int tid_fd_revalidate(struct dentry *dentry, unsigned int flags)
                }
                put_task_struct(task);
        }
-
-       d_drop(dentry);
        return 0;
 }