Lines Matching refs:hash

47 #include "hash.h"
61 /* hash class keys */
97 * batadv_choose_tt() - return the index of the tt entry in the hash table
99 * @size: the size of the hash table
101 * Return: the hash index where the object represented by 'data' should be
107 u32 hash = 0;
110 hash = jhash(&tt->addr, ETH_ALEN, hash);
111 hash = jhash(&tt->vid, sizeof(tt->vid), hash);
113 return hash % size;
117 * batadv_tt_hash_find() - look for a client in the given hash table
118 * @hash: the hash table to search
126 batadv_tt_hash_find(struct batadv_hashtable *hash, const u8 *addr,
133 if (!hash)
139 index = batadv_choose_tt(&to_search, hash->size);
140 head = &hash->table[index];
615 /* drop reference of remove hash entry */
752 /* remove the reference for the hash */
1121 * @hash: hash to dump
1131 struct batadv_hashtable *hash, unsigned int bucket,
1137 spin_lock_bh(&hash->list_locks[bucket]);
1138 cb->seq = atomic_read(&hash->generation) << 1 | 1;
1140 hlist_for_each_entry(common, &hash->table[bucket], hash_entry) {
1146 spin_unlock_bh(&hash->list_locks[bucket]);
1151 spin_unlock_bh(&hash->list_locks[bucket]);
1170 struct batadv_hashtable *hash;
1195 hash = bat_priv->tt.local_hash;
1197 while (bucket < hash->size) {
1199 hash, bucket, &idx))
1289 /* drop reference of remove hash entry */
1345 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
1347 spinlock_t *list_lock; /* protects write access to the hash lists */
1350 for (i = 0; i < hash->size; i++) {
1351 head = &hash->table[i];
1352 list_lock = &hash->list_locks[i];
1362 struct batadv_hashtable *hash;
1363 spinlock_t *list_lock; /* protects write access to the hash lists */
1373 hash = bat_priv->tt.local_hash;
1375 for (i = 0; i < hash->size; i++) {
1376 head = &hash->table[i];
1377 list_lock = &hash->list_locks[i];
1392 batadv_hash_destroy(hash);
1651 /* remove the reference for the hash */
1720 /* Do not remove multicast addresses from the local hash on
1726 /* remove address from local hash if present */
1945 struct batadv_hashtable *hash;
1972 hash = bat_priv->tt.global_hash;
1974 while (bucket < hash->size) {
1975 head = &hash->table[bucket];
2200 struct batadv_hashtable *hash = bat_priv->tt.global_hash;
2203 spinlock_t *list_lock; /* protects write access to the hash lists */
2206 if (!hash)
2209 for (i = 0; i < hash->size; i++) {
2210 head = &hash->table[i];
2211 list_lock = &hash->list_locks[i];
2266 struct batadv_hashtable *hash = bat_priv->tt.global_hash;
2269 spinlock_t *list_lock; /* protects write access to the hash lists */
2275 for (i = 0; i < hash->size; i++) {
2276 head = &hash->table[i];
2277 list_lock = &hash->list_locks[i];
2305 struct batadv_hashtable *hash;
2306 spinlock_t *list_lock; /* protects write access to the hash lists */
2316 hash = bat_priv->tt.global_hash;
2318 for (i = 0; i < hash->size; i++) {
2319 head = &hash->table[i];
2320 list_lock = &hash->list_locks[i];
2334 batadv_hash_destroy(hash);
2427 * produce a unique hash of the table, but since the order which is used to feed
2429 * probably sorts the clients differently, the hash function cannot be directly
2441 struct batadv_hashtable *hash = bat_priv->tt.global_hash;
2450 for (i = 0; i < hash->size; i++) {
2451 head = &hash->table[i];
2521 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
2528 for (i = 0; i < hash->size; i++) {
2529 head = &hash->table[i];
2740 * specified tt hash
2742 * @hash: hash table containing the tt entries
2748 * Fills the tvlv buff with the tt entries from the specified hash. If valid_cb
2752 struct batadv_hashtable *hash,
2774 for (i = 0; i < hash->size; i++) {
2775 head = &hash->table[i];
3602 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
3607 if (!hash)
3610 for (i = 0; i < hash->size; i++) {
3611 head = &hash->table[i];
3639 struct batadv_hashtable *hash = bat_priv->tt.local_hash;
3644 spinlock_t *list_lock; /* protects write access to the hash lists */
3647 if (!hash)
3650 for (i = 0; i < hash->size; i++) {
3651 head = &hash->table[i];
3652 list_lock = &hash->list_locks[i];