Lines Matching refs:hash

48 #include "hash.h"
62 /* hash class keys */
98 * batadv_choose_tt() - return the index of the tt entry in the hash table
100 * @size: the size of the hash table
102 * Return: the hash index where the object represented by 'data' should be
108 u32 hash = 0;
111 hash = jhash(&tt->addr, ETH_ALEN, hash);
112 hash = jhash(&tt->vid, sizeof(tt->vid), hash);
114 return hash % size;
118 * batadv_tt_hash_find() - look for a client in the given hash table
119 * @hash: the hash table to search
127 batadv_tt_hash_find(struct batadv_hashtable *hash, const u8 *addr,
134 if (!hash)
140 index = batadv_choose_tt(&to_search, hash->size);
141 head = &hash->table[index];
616 /* drop reference of remove hash entry */
753 /* remove the reference for the hash */
1074 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
1096 for (i = 0; i < hash->size; i++) {
1097 head = &hash->table[i];
1204 * @hash: hash to dump
1214 struct batadv_hashtable *hash, unsigned int bucket,
1220 spin_lock_bh(&hash->list_locks[bucket]);
1221 cb->seq = atomic_read(&hash->generation) << 1 | 1;
1223 hlist_for_each_entry(common, &hash->table[bucket], hash_entry) {
1229 spin_unlock_bh(&hash->list_locks[bucket]);
1234 spin_unlock_bh(&hash->list_locks[bucket]);
1253 struct batadv_hashtable *hash;
1278 hash = bat_priv->tt.local_hash;
1280 while (bucket < hash->size) {
1282 hash, bucket, &idx))
1374 /* drop reference of remove hash entry */
1431 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
1433 spinlock_t *list_lock; /* protects write access to the hash lists */
1436 for (i = 0; i < hash->size; i++) {
1437 head = &hash->table[i];
1438 list_lock = &hash->list_locks[i];
1448 struct batadv_hashtable *hash;
1449 spinlock_t *list_lock; /* protects write access to the hash lists */
1459 hash = bat_priv->tt.local_hash;
1461 for (i = 0; i < hash->size; i++) {
1462 head = &hash->table[i];
1463 list_lock = &hash->list_locks[i];
1478 batadv_hash_destroy(hash);
1738 /* remove the reference for the hash */
1807 /* Do not remove multicast addresses from the local hash on
1813 /* remove address from local hash if present */
1974 struct batadv_hashtable *hash = bat_priv->tt.global_hash;
1991 for (i = 0; i < hash->size; i++) {
1992 head = &hash->table[i];
2169 struct batadv_hashtable *hash;
2196 hash = bat_priv->tt.global_hash;
2198 while (bucket < hash->size) {
2199 head = &hash->table[bucket];
2428 struct batadv_hashtable *hash = bat_priv->tt.global_hash;
2431 spinlock_t *list_lock; /* protects write access to the hash lists */
2434 if (!hash)
2437 for (i = 0; i < hash->size; i++) {
2438 head = &hash->table[i];
2439 list_lock = &hash->list_locks[i];
2494 struct batadv_hashtable *hash = bat_priv->tt.global_hash;
2497 spinlock_t *list_lock; /* protects write access to the hash lists */
2503 for (i = 0; i < hash->size; i++) {
2504 head = &hash->table[i];
2505 list_lock = &hash->list_locks[i];
2533 struct batadv_hashtable *hash;
2534 spinlock_t *list_lock; /* protects write access to the hash lists */
2544 hash = bat_priv->tt.global_hash;
2546 for (i = 0; i < hash->size; i++) {
2547 head = &hash->table[i];
2548 list_lock = &hash->list_locks[i];
2562 batadv_hash_destroy(hash);
2657 * produce a unique hash of the table, but since the order which is used to feed
2659 * probably sorts the clients differently, the hash function cannot be directly
2671 struct batadv_hashtable *hash = bat_priv->tt.global_hash;
2680 for (i = 0; i < hash->size; i++) {
2681 head = &hash->table[i];
2751 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
2758 for (i = 0; i < hash->size; i++) {
2759 head = &hash->table[i];
2970 * specified tt hash
2972 * @hash: hash table containing the tt entries
2978 * Fills the tvlv buff with the tt entries from the specified hash. If valid_cb
2982 struct batadv_hashtable *hash,
3004 for (i = 0; i < hash->size; i++) {
3005 head = &hash->table[i];
3842 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
3847 if (!hash)
3850 for (i = 0; i < hash->size; i++) {
3851 head = &hash->table[i];
3879 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
3884 spinlock_t *list_lock; /* protects write access to the hash lists */
3887 if (!hash)
3890 for (i = 0; i < hash->size; i++) {
3891 head = &hash->table[i];
3892 list_lock = &hash->list_locks[i];