[PATCH 2/4] vfs: Simply when d_alloc_dname is called.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now that all implementations of d_dname use d_alloc_psuedo only consider
calling d_dname on root dentries, as all dentries returned
d_alloc_pseudo by d_alloc_pseudo are root dentries.

Signed-off-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
---
 fs/dcache.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 265e0ce9769c..c250d97befe4 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -3056,18 +3056,14 @@ char *d_path(const struct path *path, char *buf, int buflen)
 	int error;
 
 	/*
-	 * We have various synthetic filesystems that never get mounted.  On
-	 * these filesystems dentries are never used for lookup purposes, and
-	 * thus don't need to be hashed.  They also don't need a name until a
-	 * user wants to identify the object in /proc/pid/fd/.  The little hack
-	 * below allows us to generate a name for these objects on demand:
-	 *
-	 * Some pseudo inodes are mountable.  When they are mounted
-	 * path->dentry == path->mnt->mnt_root.  In that case don't call d_dname
-	 * and instead have d_path return the mounted path.
+	 * We have various synthetic files allocated with
+	 * d_alloc_pseudo that are not available through
+	 * ordinary path lookup and don't need a name until
+	 * a user wants to identify the object in
+	 * /proc/pid/fd/ or similiar.
 	 */
 	if (path->dentry->d_op && path->dentry->d_op->d_dname &&
-	    (!IS_ROOT(path->dentry) || path->dentry != path->mnt->mnt_root))
+	    IS_ROOT(path->dentry) && path->dentry != path->mnt->mnt_root)
 		return path->dentry->d_op->d_dname(path->dentry, buf, buflen);
 
 	rcu_read_lock();
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux