OSDN Git Service

dcache: d_find_alias needn't recheck IS_ROOT && DCACHE_DISCONNECTED
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 16 Jan 2014 22:17:31 +0000 (17:17 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 7 Aug 2014 18:40:10 +0000 (14:40 -0400)
If we get to this point and discover the dentry is not a root dentry, or
not DCACHE_DISCONNECTED--great, we always prefer that anyway.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/dcache.c

index 5c5f3bd..85a2aad 100644 (file)
@@ -765,12 +765,9 @@ again:
                alias = discon_alias;
                spin_lock(&alias->d_lock);
                if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
-                       if (IS_ROOT(alias) &&
-                           (alias->d_flags & DCACHE_DISCONNECTED)) {
-                               __dget_dlock(alias);
-                               spin_unlock(&alias->d_lock);
-                               return alias;
-                       }
+                       __dget_dlock(alias);
+                       spin_unlock(&alias->d_lock);
+                       return alias;
                }
                spin_unlock(&alias->d_lock);
                goto again;