Lines Matching refs:hash
43 #include "hash.h"
137 * batadv_nc_mesh_init() - initialise coding hash table and start housekeeping
397 * batadv_nc_purge_orig_hash() - traverse entire originator hash to check if
403 struct batadv_hashtable *hash = bat_priv->orig_hash;
408 if (!hash)
412 for (i = 0; i < hash->size; i++) {
413 head = &hash->table[i];
424 * batadv_nc_purge_paths() - traverse all nc paths part of the hash and remove
427 * @hash: hash table containing the nc paths to check
434 struct batadv_hashtable *hash,
441 spinlock_t *lock; /* Protects lists in hash */
444 for (i = 0; i < hash->size; i++) {
445 head = &hash->table[i];
446 lock = &hash->list_locks[i];
483 * batadv_nc_hash_key_gen() - computes the nc_path hash key
484 * @key: buffer to hold the final hash key
485 * @src: source ethernet mac address going into the hash key
486 * @dst: destination ethernet mac address going into the hash key
496 * batadv_nc_hash_choose() - compute the hash value for an nc path
497 * @data: data to hash
498 * @size: size of the hash table
500 * Return: the selected index in the hash table for the given data.
505 u32 hash = 0;
507 hash = jhash(&nc_path->prev_hop, sizeof(nc_path->prev_hop), hash);
508 hash = jhash(&nc_path->next_hop, sizeof(nc_path->next_hop), hash);
510 return hash % size;
514 * batadv_nc_hash_compare() - comparing function used in the network coding hash
541 * @hash: hash table containing the nc path
547 batadv_nc_hash_find(struct batadv_hashtable *hash,
554 if (!hash)
557 index = batadv_nc_hash_choose(data, hash->size);
558 head = &hash->table[index];
668 * @hash: to be processed hash table
675 struct batadv_hashtable *hash,
686 if (!hash)
689 /* Loop hash table bins */
690 for (i = 0; i < hash->size; i++) {
691 head = &hash->table[i];
953 * @hash: hash table containing the nc path
961 struct batadv_hashtable *hash,
971 nc_path = batadv_nc_hash_find(hash, (void *)&nc_path_key);
997 /* Add nc_path to hash table */
999 hash_added = batadv_hash_add(hash, batadv_nc_hash_compare,
1279 struct batadv_hashtable *hash = bat_priv->nc.coding_hash;
1282 if (!hash)
1288 idx = batadv_nc_hash_choose(&nc_path_key, hash->size);
1292 hlist_for_each_entry_rcu(nc_path, &hash->table[idx], hash_entry) {
1746 struct batadv_hashtable *hash = bat_priv->nc.decoding_hash;
1753 if (!hash)
1767 index = batadv_nc_hash_choose(&nc_path_key, hash->size);
1771 hlist_for_each_entry_rcu(nc_path, &hash->table[index], hash_entry) {
1900 struct batadv_hashtable *hash = bat_priv->orig_hash;
1912 for (i = 0; i < hash->size; i++) {
1913 head = &hash->table[i];