Lines Matching refs:entry
75 static void netlbl_domhsh_free_entry(struct rcu_head *entry) in netlbl_domhsh_free_entry() argument
85 ptr = container_of(entry, struct netlbl_dom_map, rcu); in netlbl_domhsh_free_entry()
172 struct netlbl_dom_map *entry; in netlbl_domhsh_search_def() local
174 entry = netlbl_domhsh_search(domain); in netlbl_domhsh_search_def()
175 if (entry == NULL) { in netlbl_domhsh_search_def()
176 entry = netlbl_domhsh_rcu_deref(netlbl_domhsh_def); in netlbl_domhsh_search_def()
177 if (entry != NULL && !entry->valid) in netlbl_domhsh_search_def()
178 entry = NULL; in netlbl_domhsh_search_def()
181 return entry; in netlbl_domhsh_search_def()
198 static void netlbl_domhsh_audit_add(struct netlbl_dom_map *entry, in netlbl_domhsh_audit_add() argument
211 entry->domain ? entry->domain : "(default)"); in netlbl_domhsh_audit_add()
228 type = entry->def.type; in netlbl_domhsh_audit_add()
229 cipsov4 = entry->def.cipso; in netlbl_domhsh_audit_add()
255 static int netlbl_domhsh_validate(const struct netlbl_dom_map *entry) in netlbl_domhsh_validate() argument
264 if (entry == NULL) in netlbl_domhsh_validate()
267 switch (entry->def.type) { in netlbl_domhsh_validate()
269 if (entry->def.cipso != NULL || entry->def.addrsel != NULL) in netlbl_domhsh_validate()
273 if (entry->def.cipso == NULL) in netlbl_domhsh_validate()
277 netlbl_af4list_foreach(iter4, &entry->def.addrsel->list4) { in netlbl_domhsh_validate()
293 netlbl_af6list_foreach(iter6, &entry->def.addrsel->list6) { in netlbl_domhsh_validate()
365 int netlbl_domhsh_add(struct netlbl_dom_map *entry, in netlbl_domhsh_add() argument
377 ret_val = netlbl_domhsh_validate(entry); in netlbl_domhsh_add()
387 if (entry->domain != NULL) in netlbl_domhsh_add()
388 entry_old = netlbl_domhsh_search(entry->domain); in netlbl_domhsh_add()
390 entry_old = netlbl_domhsh_search_def(entry->domain); in netlbl_domhsh_add()
392 entry->valid = 1; in netlbl_domhsh_add()
394 if (entry->domain != NULL) { in netlbl_domhsh_add()
395 u32 bkt = netlbl_domhsh_hash(entry->domain); in netlbl_domhsh_add()
396 list_add_tail_rcu(&entry->list, in netlbl_domhsh_add()
399 INIT_LIST_HEAD(&entry->list); in netlbl_domhsh_add()
400 rcu_assign_pointer(netlbl_domhsh_def, entry); in netlbl_domhsh_add()
403 if (entry->def.type == NETLBL_NLTYPE_ADDRSELECT) { in netlbl_domhsh_add()
405 &entry->def.addrsel->list4) in netlbl_domhsh_add()
406 netlbl_domhsh_audit_add(entry, iter4, NULL, in netlbl_domhsh_add()
410 &entry->def.addrsel->list6) in netlbl_domhsh_add()
411 netlbl_domhsh_audit_add(entry, NULL, iter6, in netlbl_domhsh_add()
415 netlbl_domhsh_audit_add(entry, NULL, NULL, in netlbl_domhsh_add()
418 entry->def.type == NETLBL_NLTYPE_ADDRSELECT) { in netlbl_domhsh_add()
427 netlbl_af4list_foreach_rcu(iter4, &entry->def.addrsel->list4) in netlbl_domhsh_add()
435 netlbl_af6list_foreach_rcu(iter6, &entry->def.addrsel->list6) in netlbl_domhsh_add()
445 &entry->def.addrsel->list4) { in netlbl_domhsh_add()
456 &entry->def.addrsel->list6) { in netlbl_domhsh_add()
486 int netlbl_domhsh_add_default(struct netlbl_dom_map *entry, in netlbl_domhsh_add_default() argument
489 return netlbl_domhsh_add(entry, audit_info); in netlbl_domhsh_add_default()
504 int netlbl_domhsh_remove_entry(struct netlbl_dom_map *entry, in netlbl_domhsh_remove_entry() argument
510 if (entry == NULL) in netlbl_domhsh_remove_entry()
514 if (entry->valid) { in netlbl_domhsh_remove_entry()
515 entry->valid = 0; in netlbl_domhsh_remove_entry()
516 if (entry != rcu_dereference(netlbl_domhsh_def)) in netlbl_domhsh_remove_entry()
517 list_del_rcu(&entry->list); in netlbl_domhsh_remove_entry()
528 entry->domain ? entry->domain : "(default)", in netlbl_domhsh_remove_entry()
537 switch (entry->def.type) { in netlbl_domhsh_remove_entry()
540 &entry->def.addrsel->list4) { in netlbl_domhsh_remove_entry()
548 cipso_v4_doi_putdef(entry->def.cipso); in netlbl_domhsh_remove_entry()
551 call_rcu(&entry->rcu, netlbl_domhsh_free_entry); in netlbl_domhsh_remove_entry()
581 struct netlbl_domaddr4_map *entry; in netlbl_domhsh_remove_af4() local
615 entry = netlbl_domhsh_addr4_entry(entry_addr); in netlbl_domhsh_remove_af4()
616 cipso_v4_doi_putdef(entry->def.cipso); in netlbl_domhsh_remove_af4()
617 kfree(entry); in netlbl_domhsh_remove_af4()
639 struct netlbl_dom_map *entry; in netlbl_domhsh_remove() local
643 entry = netlbl_domhsh_search(domain); in netlbl_domhsh_remove()
645 entry = netlbl_domhsh_search_def(domain); in netlbl_domhsh_remove()
646 ret_val = netlbl_domhsh_remove_entry(entry, audit_info); in netlbl_domhsh_remove()
759 int (*callback) (struct netlbl_dom_map *entry, void *arg), in netlbl_domhsh_walk()