Lines Matching refs:f
70 #define DN_FIB_SCAN(f, fp) \ argument
71 for( ; ((f) = *(fp)) != NULL; (fp) = &(f)->fn_next)
73 #define DN_FIB_SCAN_KEY(f, fp, key) \ argument
74 for( ; ((f) = *(fp)) != NULL && dn_key_eq((f)->fn_key, (key)); (fp) = &(f)->fn_next)
125 struct dn_fib_node *f, **fp, *next; in dn_rebuild_zone() local
128 for(f = old_ht[i]; f; f = f->fn_next) { in dn_rebuild_zone()
129 next = f->fn_next; in dn_rebuild_zone()
130 for(fp = dn_chain_p(f->fn_key, dz); in dn_rebuild_zone()
131 *fp && dn_key_leq((*fp)->fn_key, f->fn_key); in dn_rebuild_zone()
134 f->fn_next = *fp; in dn_rebuild_zone()
135 *fp = f; in dn_rebuild_zone()
177 static void dn_free_node(struct dn_fib_node *f) in dn_free_node() argument
179 dn_fib_release_info(DN_FIB_INFO(f)); in dn_free_node()
180 kmem_cache_free(dn_hash_kmem, f); in dn_free_node()
332 static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, int tb_id, in dn_rtmsg_fib() argument
344 f->fn_type, f->fn_scope, &f->fn_key, z, in dn_rtmsg_fib()
345 DN_FIB_INFO(f)) < 0) { in dn_rtmsg_fib()
361 struct dn_fib_node *f) in dn_hash_dump_bucket() argument
366 for(i = 0; f; i++, f = f->fn_next) { in dn_hash_dump_bucket()
369 if (f->fn_state & DN_S_ZOMBIE) in dn_hash_dump_bucket()
375 (f->fn_state & DN_S_ZOMBIE) ? 0 : f->fn_type, in dn_hash_dump_bucket()
376 f->fn_scope, &f->fn_key, dz->dz_order, in dn_hash_dump_bucket()
377 f->fn_info) < 0) { in dn_hash_dump_bucket()
440 struct dn_fib_node *new_f, *f, **fp, **del_fp; in dn_fib_table_insert() local
474 DN_FIB_SCAN(f, fp) { in dn_fib_table_insert()
475 if (dn_key_leq(key, f->fn_key)) in dn_fib_table_insert()
481 if (f && (f->fn_state & DN_S_ZOMBIE) && in dn_fib_table_insert()
482 dn_key_eq(f->fn_key, key)) { in dn_fib_table_insert()
484 fp = &f->fn_next; in dn_fib_table_insert()
485 f = *fp; in dn_fib_table_insert()
489 DN_FIB_SCAN_KEY(f, fp, key) { in dn_fib_table_insert()
490 if (fi->fib_priority <= DN_FIB_INFO(f)->fib_priority) in dn_fib_table_insert()
494 if (f && dn_key_eq(f->fn_key, key) && in dn_fib_table_insert()
495 fi->fib_priority == DN_FIB_INFO(f)->fib_priority) { in dn_fib_table_insert()
504 fp = &f->fn_next; in dn_fib_table_insert()
505 f = *fp; in dn_fib_table_insert()
512 DN_FIB_SCAN_KEY(f, fp, key) { in dn_fib_table_insert()
513 if (fi->fib_priority != DN_FIB_INFO(f)->fib_priority) in dn_fib_table_insert()
515 if (f->fn_type == type && f->fn_scope == r->rtm_scope in dn_fib_table_insert()
516 && DN_FIB_INFO(f) == fi) in dn_fib_table_insert()
522 f = *fp; in dn_fib_table_insert()
544 new_f->fn_next = f; in dn_fib_table_insert()
551 f = *del_fp; in dn_fib_table_insert()
553 *del_fp = f->fn_next; in dn_fib_table_insert()
556 if (!(f->fn_state & DN_S_ZOMBIE)) in dn_fib_table_insert()
557 dn_rtmsg_fib(RTM_DELROUTE, f, z, tb->n, n, req); in dn_fib_table_insert()
558 if (f->fn_state & DN_S_ACCESSED) in dn_fib_table_insert()
560 dn_free_node(f); in dn_fib_table_insert()
578 struct dn_fib_node **fp, **del_fp, *f; in dn_fib_table_delete() local
602 DN_FIB_SCAN(f, fp) { in dn_fib_table_delete()
603 if (dn_key_eq(f->fn_key, key)) in dn_fib_table_delete()
605 if (dn_key_leq(key, f->fn_key)) in dn_fib_table_delete()
611 DN_FIB_SCAN_KEY(f, fp, key) { in dn_fib_table_delete()
612 struct dn_fib_info *fi = DN_FIB_INFO(f); in dn_fib_table_delete()
614 if (f->fn_state & DN_S_ZOMBIE) in dn_fib_table_delete()
620 (!r->rtm_type || f->fn_type == r->rtm_type) && in dn_fib_table_delete()
621 (r->rtm_scope == RT_SCOPE_NOWHERE || f->fn_scope == r->rtm_scope) && in dn_fib_table_delete()
629 f = *del_fp; in dn_fib_table_delete()
630 dn_rtmsg_fib(RTM_DELROUTE, f, z, tb->n, n, req); in dn_fib_table_delete()
634 *del_fp = f->fn_next; in dn_fib_table_delete()
637 if (f->fn_state & DN_S_ACCESSED) in dn_fib_table_delete()
639 dn_free_node(f); in dn_fib_table_delete()
642 f->fn_state |= DN_S_ZOMBIE; in dn_fib_table_delete()
643 if (f->fn_state & DN_S_ACCESSED) { in dn_fib_table_delete()
644 f->fn_state &= ~DN_S_ACCESSED; in dn_fib_table_delete()
660 struct dn_fib_node *f; in dn_flush_list() local
662 while((f = *fp) != NULL) { in dn_flush_list()
663 struct dn_fib_info *fi = DN_FIB_INFO(f); in dn_flush_list()
665 if (fi && ((f->fn_state & DN_S_ZOMBIE) || (fi->fib_flags & RTNH_F_DEAD))) { in dn_flush_list()
667 *fp = f->fn_next; in dn_flush_list()
670 dn_free_node(f); in dn_flush_list()
674 fp = &f->fn_next; in dn_flush_list()
708 struct dn_fib_node *f; in dn_fib_table_lookup() local
711 for(f = dz_chain(k, dz); f; f = f->fn_next) { in dn_fib_table_lookup()
712 if (!dn_key_leq(k, f->fn_key)) in dn_fib_table_lookup()
717 f->fn_state |= DN_S_ACCESSED; in dn_fib_table_lookup()
719 if (f->fn_state&DN_S_ZOMBIE) in dn_fib_table_lookup()
721 if (f->fn_scope < key->scope) in dn_fib_table_lookup()
724 err = dn_fib_semantic_match(f->fn_type, DN_FIB_INFO(f), key, res); in dn_fib_table_lookup()
726 res->type = f->fn_type; in dn_fib_table_lookup()
727 res->scope = f->fn_scope; in dn_fib_table_lookup()
789 struct dn_fib_node *f; in dn_fib_table_get_info() local
802 for(f = *fp; f ; f = f->fn_next) { in dn_fib_table_get_info()
805 dn_fib_node_get_info(f->fn_type, in dn_fib_table_get_info()
806 f->fn_state & DN_S_ZOMBIE, in dn_fib_table_get_info()
807 DN_FIB_INFO(f), in dn_fib_table_get_info()
808 dz_prefix(f->fn_key, dz), in dn_fib_table_get_info()