Lines Matching refs:hash
16 #include <linux/hash.h>
306 * kernfs_name_hash - calculate hash of @ns + @name
307 * @name: Null terminated string to hash
308 * @ns: Namespace tag to hash
310 * Return: 31-bit hash of ns + name (so it fits in an off_t)
314 unsigned long hash = init_name_hash(ns);
317 hash = partial_name_hash(*name++, hash);
318 hash = end_name_hash(hash);
319 hash &= 0x7fffffffU;
320 /* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */
321 if (hash < 2)
322 hash += 2;
323 if (hash >= INT_MAX)
324 hash = INT_MAX - 1;
325 return hash;
328 static int kernfs_name_compare(unsigned int hash, const char *name,
331 if (hash < kn->hash)
333 if (hash > kn->hash)
345 return kernfs_name_compare(left->hash, left->name, left->ns, right);
793 kn->hash = kernfs_name_hash(kn->name, kn->ns);
843 unsigned int hash;
853 hash = kernfs_name_hash(name, ns);
859 result = kernfs_name_compare(hash, name, ns, kn);
1228 /* instantiate and hash (possibly negative) dentry */
1774 kn->hash = kernfs_name_hash(kn->name, kn->ns);
1793 struct kernfs_node *parent, loff_t hash, struct kernfs_node *pos)
1797 pos->parent == parent && hash == pos->hash;
1802 if (!pos && (hash > 1) && (hash < INT_MAX)) {
1807 if (hash < pos->hash)
1809 else if (hash > pos->hash)
1867 ctx->pos = pos->hash;