Lines Matching +full:first +full:- +full:generation
1 /* SPDX-License-Identifier: GPL-2.0 */
31 * Return: an index based on the key in the data of the first argument and the
38 * struct batadv_hashtable - Wrapper of simple hlist based hashtable
50 /** @generation: current (generation) sequence number */
51 atomic_t generation; member
65 * batadv_hash_add() - adds data to the hashtable
73 * and -1 on error.
82 int ret = -1; in batadv_hash_add()
90 index = choose(data, hash->size); in batadv_hash_add()
91 head = &hash->table[index]; in batadv_hash_add()
92 list_lock = &hash->list_locks[index]; in batadv_hash_add()
106 atomic_inc(&hash->generation); in batadv_hash_add()
117 * batadv_hash_remove() - Removes data from hash, if found
139 index = choose(data, hash->size); in batadv_hash_remove()
140 head = &hash->table[index]; in batadv_hash_remove()
142 spin_lock_bh(&hash->list_locks[index]); in batadv_hash_remove()
149 atomic_inc(&hash->generation); in batadv_hash_remove()
152 spin_unlock_bh(&hash->list_locks[index]); in batadv_hash_remove()