Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[muen/linux.git] / fs / dcache.c
index 831f3a9a8f05282b8ba9aae9c6ed963334b9b8f3..7ece68d0d4dbd731295ee8eec1ab0e4d4d504065 100644 (file)
@@ -3573,8 +3573,6 @@ __setup("dhash_entries=", set_dhash_entries);
 
 static void __init dcache_init_early(void)
 {
-       unsigned int loop;
-
        /* If hashes are distributed across NUMA nodes, defer
         * hash allocation until vmalloc space is available.
         */
@@ -3586,24 +3584,19 @@ static void __init dcache_init_early(void)
                                        sizeof(struct hlist_bl_head),
                                        dhash_entries,
                                        13,
-                                       HASH_EARLY,
+                                       HASH_EARLY | HASH_ZERO,
                                        &d_hash_shift,
                                        &d_hash_mask,
                                        0,
                                        0);
-
-       for (loop = 0; loop < (1U << d_hash_shift); loop++)
-               INIT_HLIST_BL_HEAD(dentry_hashtable + loop);
 }
 
 static void __init dcache_init(void)
 {
-       unsigned int loop;
-
-       /* 
+       /*
         * A constructor could be added for stable state like the lists,
         * but it is probably not worth it because of the cache nature
-        * of the dcache. 
+        * of the dcache.
         */
        dentry_cache = KMEM_CACHE(dentry,
                SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD|SLAB_ACCOUNT);
@@ -3617,14 +3610,11 @@ static void __init dcache_init(void)
                                        sizeof(struct hlist_bl_head),
                                        dhash_entries,
                                        13,
-                                       0,
+                                       HASH_ZERO,
                                        &d_hash_shift,
                                        &d_hash_mask,
                                        0,
                                        0);
-
-       for (loop = 0; loop < (1U << d_hash_shift); loop++)
-               INIT_HLIST_BL_HEAD(dentry_hashtable + loop);
 }
 
 /* SLAB cache for __getname() consumers */