vfs: make the string hashes salt the hash
[cascardo/linux.git] / fs / kernfs / dir.c
index 8a65240..e57174d 100644 (file)
@@ -336,11 +336,11 @@ struct kernfs_node *kernfs_get_parent(struct kernfs_node *kn)
  */
 static unsigned int kernfs_name_hash(const char *name, const void *ns)
 {
-       unsigned long hash = init_name_hash();
+       unsigned long hash = init_name_hash(ns);
        unsigned int len = strlen(name);
        while (len--)
                hash = partial_name_hash(*name++, hash);
-       hash = (end_name_hash(hash) ^ hash_ptr((void *)ns, 31));
+       hash = end_name_hash(hash);
        hash &= 0x7fffffffU;
        /* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */
        if (hash < 2)