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)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 9 Oct 2014 06:38:58 +0000 (02:38 -0400)
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>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ceph/dir.c
fs/proc/base.c
fs/proc/fd.c

index c29d6ae6887489c29902bec33c4118d4d807e9dc..b6c59eaa4f64356ba069219551c78870035d74d9 100644 (file)
@@ -1069,7 +1069,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 baf852b648ad7d2b4512d7279d5e97a0fb473cb6..b4fe0ee089423ff4e9f123748f91462d11129f9f 100644 (file)
@@ -1590,7 +1590,6 @@ int pid_revalidate(struct dentry *dentry, unsigned int flags)
                put_task_struct(task);
                return 1;
        }
-       d_drop(dentry);
        return 0;
 }
 
@@ -1727,9 +1726,6 @@ out:
        put_task_struct(task);
 
 out_notask:
-       if (status <= 0)
-               d_drop(dentry);
-
        return status;
 }
 
index 955bb55fab8cad3fbdfbd8e69f5536e6c2e53593..e11d7c590bb0bdee4004f84f21423a4e6e6693c3 100644 (file)
@@ -129,8 +129,6 @@ static int tid_fd_revalidate(struct dentry *dentry, unsigned int flags)
                }
                put_task_struct(task);
        }
-
-       d_drop(dentry);
        return 0;
 }