Lines Matching refs:hash
120 unsigned int hash) in rht_bucket_index() argument
122 return hash & (tbl->size - 1); in rht_bucket_index()
129 unsigned int hash; in rht_key_get_hash() local
133 hash = ht->p.hashfn(key, ht->key_len, hash_rnd); in rht_key_get_hash()
138 hash = params.hashfn(key, key_len, hash_rnd); in rht_key_get_hash()
140 hash = jhash(key, key_len, hash_rnd); in rht_key_get_hash()
142 hash = jhash2(key, key_len / sizeof(u32), hash_rnd); in rht_key_get_hash()
147 hash = params.hashfn(key, key_len, hash_rnd); in rht_key_get_hash()
149 hash = jhash(key, key_len, hash_rnd); in rht_key_get_hash()
152 return hash; in rht_key_get_hash()
159 unsigned int hash = rht_key_get_hash(ht, key, params, tbl->hash_rnd); in rht_key_hashfn() local
161 return rht_bucket_index(tbl, hash); in rht_key_hashfn()
228 int lockdep_rht_bucket_is_held(const struct bucket_table *tbl, u32 hash);
236 u32 hash) in lockdep_rht_bucket_is_held() argument
265 const struct bucket_table *tbl, unsigned int hash);
267 const struct bucket_table *tbl, unsigned int hash);
269 struct rhashtable *ht, struct bucket_table *tbl, unsigned int hash);
277 #define rht_dereference_bucket(p, tbl, hash) \ argument
278 rcu_dereference_protected(p, lockdep_rht_bucket_is_held(tbl, hash))
280 #define rht_dereference_bucket_rcu(p, tbl, hash) \ argument
281 rcu_dereference_check(p, lockdep_rht_bucket_is_held(tbl, hash))
287 const struct bucket_table *tbl, unsigned int hash) in rht_bucket() argument
289 return unlikely(tbl->nest) ? rht_bucket_nested(tbl, hash) : in rht_bucket()
290 &tbl->buckets[hash]; in rht_bucket()
294 struct bucket_table *tbl, unsigned int hash) in rht_bucket_var() argument
296 return unlikely(tbl->nest) ? __rht_bucket_nested(tbl, hash) : in rht_bucket_var()
297 &tbl->buckets[hash]; in rht_bucket_var()
301 struct rhashtable *ht, struct bucket_table *tbl, unsigned int hash) in rht_bucket_insert() argument
303 return unlikely(tbl->nest) ? rht_bucket_nested_insert(ht, tbl, hash) : in rht_bucket_insert()
304 &tbl->buckets[hash]; in rht_bucket_insert()
382 unsigned int hash) in rht_ptr() argument
384 return __rht_ptr(rht_dereference_bucket(*bkt, tbl, hash), bkt); in rht_ptr()
422 #define rht_for_each_from(pos, head, tbl, hash) \ argument
425 pos = rht_dereference_bucket((pos)->next, tbl, hash))
433 #define rht_for_each(pos, tbl, hash) \ argument
434 rht_for_each_from(pos, rht_ptr(rht_bucket(tbl, hash), tbl, hash), \
435 tbl, hash)
446 #define rht_for_each_entry_from(tpos, pos, head, tbl, hash, member) \ argument
449 pos = rht_dereference_bucket((pos)->next, tbl, hash))
459 #define rht_for_each_entry(tpos, pos, tbl, hash, member) \ argument
461 rht_ptr(rht_bucket(tbl, hash), tbl, hash), \
462 tbl, hash, member)
476 #define rht_for_each_entry_safe(tpos, pos, next, tbl, hash, member) \ argument
477 for (pos = rht_ptr(rht_bucket(tbl, hash), tbl, hash), \
479 rht_dereference_bucket(pos->next, tbl, hash) : NULL; \
483 rht_dereference_bucket(pos->next, tbl, hash) : NULL)
496 #define rht_for_each_rcu_from(pos, head, tbl, hash) \ argument
512 #define rht_for_each_rcu(pos, tbl, hash) \ argument
514 pos = rht_ptr_rcu(rht_bucket(tbl, hash)); \
531 #define rht_for_each_entry_rcu_from(tpos, pos, head, tbl, hash, member) \ argument
535 pos = rht_dereference_bucket_rcu(pos->next, tbl, hash))
549 #define rht_for_each_entry_rcu(tpos, pos, tbl, hash, member) \ argument
551 rht_ptr_rcu(rht_bucket(tbl, hash)), \
552 tbl, hash, member)
600 unsigned int hash; in __rhashtable_lookup() local
604 hash = rht_key_hashfn(ht, tbl, key, params); in __rhashtable_lookup()
605 bkt = rht_bucket(tbl, hash); in __rhashtable_lookup()
607 rht_for_each_rcu_from(he, rht_ptr_rcu(bkt), tbl, hash) { in __rhashtable_lookup()
718 unsigned int hash; in __rhashtable_insert_fast() local
725 hash = rht_head_hashfn(ht, tbl, obj, params); in __rhashtable_insert_fast()
727 bkt = rht_bucket_insert(ht, tbl, hash); in __rhashtable_insert_fast()
741 rht_for_each_from(head, rht_ptr(bkt, tbl, hash), tbl, hash) { in __rhashtable_insert_fast()
764 head = rht_dereference_bucket(head->next, tbl, hash); in __rhashtable_insert_fast()
786 head = rht_ptr(bkt, tbl, hash); in __rhashtable_insert_fast()
1004 unsigned int hash; in __rhashtable_remove_fast_one() local
1007 hash = rht_head_hashfn(ht, tbl, obj, params); in __rhashtable_remove_fast_one()
1008 bkt = rht_bucket_var(tbl, hash); in __rhashtable_remove_fast_one()
1014 rht_for_each_from(he, rht_ptr(bkt, tbl, hash), tbl, hash) { in __rhashtable_remove_fast_one()
1030 tbl, hash); in __rhashtable_remove_fast_one()
1036 list = rht_dereference_bucket(list->next, tbl, hash); in __rhashtable_remove_fast_one()
1042 obj = rht_dereference_bucket(obj->next, tbl, hash); in __rhashtable_remove_fast_one()
1046 list = rht_dereference_bucket(list->next, tbl, hash); in __rhashtable_remove_fast_one()
1157 unsigned int hash; in __rhashtable_replace_fast() local
1163 hash = rht_head_hashfn(ht, tbl, obj_old, params); in __rhashtable_replace_fast()
1164 if (hash != rht_head_hashfn(ht, tbl, obj_new, params)) in __rhashtable_replace_fast()
1167 bkt = rht_bucket_var(tbl, hash); in __rhashtable_replace_fast()
1174 rht_for_each_from(he, rht_ptr(bkt, tbl, hash), tbl, hash) { in __rhashtable_replace_fast()