dcache: use IS_ROOT to decide where dentry is hashed
[platform/adaptation/renesas_rcar/renesas_kernel.git] / fs / dcache.c
index 525770e..c2add37 100644 (file)
@@ -503,7 +503,12 @@ void __d_drop(struct dentry *dentry)
 {
        if (!d_unhashed(dentry)) {
                struct hlist_bl_head *b;
-               if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED))
+               /*
+                * Hashed dentries are normally on the dentry hashtable,
+                * with the exception of those newly allocated by
+                * d_obtain_alias, which are always IS_ROOT:
+                */
+               if (unlikely(IS_ROOT(dentry)))
                        b = &dentry->d_sb->s_anon;
                else
                        b = d_hash(dentry->d_parent, dentry->d_name.hash);