Lines Matching refs:hash
16 #include <linux/hash.h>
302 * @name: Null terminated string to hash
303 * @ns: Namespace tag to hash
305 * Returns 31 bit hash of ns + name (so it fits in an off_t )
309 unsigned long hash = init_name_hash(ns);
312 hash = partial_name_hash(*name++, hash);
313 hash = end_name_hash(hash);
314 hash &= 0x7fffffffU;
315 /* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */
316 if (hash < 2)
317 hash += 2;
318 if (hash >= INT_MAX)
319 hash = INT_MAX - 1;
320 return hash;
323 static int kernfs_name_compare(unsigned int hash, const char *name,
326 if (hash < kn->hash)
328 if (hash > kn->hash)
340 return kernfs_name_compare(left->hash, left->name, left->ns, right);
807 kn->hash = kernfs_name_hash(kn->name, kn->ns);
853 unsigned int hash;
863 hash = kernfs_name_hash(name, ns);
869 result = kernfs_name_compare(hash, name, ns, kn);
1128 /* instantiate and hash dentry */
1614 kn->hash = kernfs_name_hash(kn->name, kn->ns);
1639 struct kernfs_node *parent, loff_t hash, struct kernfs_node *pos)
1643 pos->parent == parent && hash == pos->hash;
1648 if (!pos && (hash > 1) && (hash < INT_MAX)) {
1653 if (hash < pos->hash)
1655 else if (hash > pos->hash)
1710 ctx->pos = pos->hash;