]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/inode.c
powerpc/watchdog: Fix final-check recovered case
[karo-tx-linux.git] / fs / inode.c
index ab3b9a795c0b73130968e04e388d8160017106fd..50370599e37104708b95ede3a627052cc0d910d3 100644 (file)
@@ -1915,8 +1915,6 @@ __setup("ihash_entries=", set_ihash_entries);
  */
 void __init inode_init_early(void)
 {
-       unsigned int loop;
-
        /* If hashes are distributed across NUMA nodes, defer
         * hash allocation until vmalloc space is available.
         */
@@ -1928,20 +1926,15 @@ void __init inode_init_early(void)
                                        sizeof(struct hlist_head),
                                        ihash_entries,
                                        14,
-                                       HASH_EARLY,
+                                       HASH_EARLY | HASH_ZERO,
                                        &i_hash_shift,
                                        &i_hash_mask,
                                        0,
                                        0);
-
-       for (loop = 0; loop < (1U << i_hash_shift); loop++)
-               INIT_HLIST_HEAD(&inode_hashtable[loop]);
 }
 
 void __init inode_init(void)
 {
-       unsigned int loop;
-
        /* inode slab cache */
        inode_cachep = kmem_cache_create("inode_cache",
                                         sizeof(struct inode),
@@ -1959,14 +1952,11 @@ void __init inode_init(void)
                                        sizeof(struct hlist_head),
                                        ihash_entries,
                                        14,
-                                       0,
+                                       HASH_ZERO,
                                        &i_hash_shift,
                                        &i_hash_mask,
                                        0,
                                        0);
-
-       for (loop = 0; loop < (1U << i_hash_shift); loop++)
-               INIT_HLIST_HEAD(&inode_hashtable[loop]);
 }
 
 void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev)
@@ -2024,7 +2014,7 @@ bool inode_owner_or_capable(const struct inode *inode)
                return true;
 
        ns = current_user_ns();
-       if (ns_capable(ns, CAP_FOWNER) && kuid_has_mapping(ns, inode->i_uid))
+       if (kuid_has_mapping(ns, inode->i_uid) && ns_capable(ns, CAP_FOWNER))
                return true;
        return false;
 }