Lines Matching refs:hash
15 static void batadv_hash_init(struct batadv_hashtable *hash) in batadv_hash_init() argument
19 for (i = 0; i < hash->size; i++) { in batadv_hash_init()
20 INIT_HLIST_HEAD(&hash->table[i]); in batadv_hash_init()
21 spin_lock_init(&hash->list_locks[i]); in batadv_hash_init()
24 atomic_set(&hash->generation, 0); in batadv_hash_init()
31 void batadv_hash_destroy(struct batadv_hashtable *hash) in batadv_hash_destroy() argument
33 kfree(hash->list_locks); in batadv_hash_destroy()
34 kfree(hash->table); in batadv_hash_destroy()
35 kfree(hash); in batadv_hash_destroy()
46 struct batadv_hashtable *hash; in batadv_hash_new() local
48 hash = kmalloc(sizeof(*hash), GFP_ATOMIC); in batadv_hash_new()
49 if (!hash) in batadv_hash_new()
52 hash->table = kmalloc_array(size, sizeof(*hash->table), GFP_ATOMIC); in batadv_hash_new()
53 if (!hash->table) in batadv_hash_new()
56 hash->list_locks = kmalloc_array(size, sizeof(*hash->list_locks), in batadv_hash_new()
58 if (!hash->list_locks) in batadv_hash_new()
61 hash->size = size; in batadv_hash_new()
62 batadv_hash_init(hash); in batadv_hash_new()
63 return hash; in batadv_hash_new()
66 kfree(hash->table); in batadv_hash_new()
68 kfree(hash); in batadv_hash_new()
77 void batadv_hash_set_lock_class(struct batadv_hashtable *hash, in batadv_hash_set_lock_class() argument
82 for (i = 0; i < hash->size; i++) in batadv_hash_set_lock_class()
83 lockdep_set_class(&hash->list_locks[i], key); in batadv_hash_set_lock_class()