Lines Matching refs:h
68 avtab_insert_node(struct avtab *h, int hvalue, in avtab_insert_node() argument
82 newnode->next = flex_array_get_ptr(h->htable, hvalue); in avtab_insert_node()
83 if (flex_array_put_ptr(h->htable, hvalue, newnode, in avtab_insert_node()
90 h->nel++; in avtab_insert_node()
94 static int avtab_insert(struct avtab *h, struct avtab_key *key, struct avtab_datum *datum) in avtab_insert() argument
100 if (!h || !h->htable) in avtab_insert()
103 hvalue = avtab_hash(key, h->mask); in avtab_insert()
104 for (prev = NULL, cur = flex_array_get_ptr(h->htable, hvalue); in avtab_insert()
123 newnode = avtab_insert_node(h, hvalue, prev, cur, key, datum); in avtab_insert()
135 avtab_insert_nonunique(struct avtab *h, struct avtab_key *key, struct avtab_datum *datum) in avtab_insert_nonunique() argument
141 if (!h || !h->htable) in avtab_insert_nonunique()
143 hvalue = avtab_hash(key, h->mask); in avtab_insert_nonunique()
144 for (prev = NULL, cur = flex_array_get_ptr(h->htable, hvalue); in avtab_insert_nonunique()
162 return avtab_insert_node(h, hvalue, prev, cur, key, datum); in avtab_insert_nonunique()
165 struct avtab_datum *avtab_search(struct avtab *h, struct avtab_key *key) in avtab_search() argument
171 if (!h || !h->htable) in avtab_search()
174 hvalue = avtab_hash(key, h->mask); in avtab_search()
175 for (cur = flex_array_get_ptr(h->htable, hvalue); cur; in avtab_search()
201 avtab_search_node(struct avtab *h, struct avtab_key *key) in avtab_search_node() argument
207 if (!h || !h->htable) in avtab_search_node()
210 hvalue = avtab_hash(key, h->mask); in avtab_search_node()
211 for (cur = flex_array_get_ptr(h->htable, hvalue); cur; in avtab_search_node()
261 void avtab_destroy(struct avtab *h) in avtab_destroy() argument
266 if (!h || !h->htable) in avtab_destroy()
269 for (i = 0; i < h->nslot; i++) { in avtab_destroy()
270 cur = flex_array_get_ptr(h->htable, i); in avtab_destroy()
277 flex_array_free(h->htable); in avtab_destroy()
278 h->htable = NULL; in avtab_destroy()
279 h->nslot = 0; in avtab_destroy()
280 h->mask = 0; in avtab_destroy()
283 int avtab_init(struct avtab *h) in avtab_init() argument
285 h->htable = NULL; in avtab_init()
286 h->nel = 0; in avtab_init()
290 int avtab_alloc(struct avtab *h, u32 nrules) in avtab_alloc() argument
311 h->htable = flex_array_alloc(sizeof(struct avtab_node *), nslot, in avtab_alloc()
313 if (!h->htable) in avtab_alloc()
317 h->nel = 0; in avtab_alloc()
318 h->nslot = nslot; in avtab_alloc()
319 h->mask = mask; in avtab_alloc()
321 h->nslot, nrules); in avtab_alloc()
325 void avtab_hash_eval(struct avtab *h, char *tag) in avtab_hash_eval() argument
334 for (i = 0; i < h->nslot; i++) { in avtab_hash_eval()
335 cur = flex_array_get_ptr(h->htable, i); in avtab_hash_eval()
352 tag, h->nel, slots_used, h->nslot, max_chain_len, in avtab_hash_eval()