Lines Matching refs:sr

147 	struct service_range *sr;  in tipc_service_first_range()  local
150 sr = container_of(n, struct service_range, tree_node); in tipc_service_first_range()
151 if (sr->lower > instance) in tipc_service_first_range()
153 else if (sr->upper < instance) in tipc_service_first_range()
156 return sr; in tipc_service_first_range()
167 struct service_range *sr; in tipc_service_find_range() local
169 sr = tipc_service_first_range(sc, lower); in tipc_service_find_range()
170 if (!sr) in tipc_service_find_range()
174 for (n = &sr->tree_node; n; n = rb_next(n)) { in tipc_service_find_range()
175 sr = container_of(n, struct service_range, tree_node); in tipc_service_find_range()
176 if (sr->upper == upper) in tipc_service_find_range()
179 if (!n || sr->lower != lower || sr->upper != upper) in tipc_service_find_range()
182 return sr; in tipc_service_find_range()
189 struct service_range *sr, *tmp; in tipc_service_create_range() local
207 sr = kzalloc(sizeof(*sr), GFP_ATOMIC); in tipc_service_create_range()
208 if (!sr) in tipc_service_create_range()
210 sr->lower = lower; in tipc_service_create_range()
211 sr->upper = upper; in tipc_service_create_range()
212 INIT_LIST_HEAD(&sr->local_publ); in tipc_service_create_range()
213 INIT_LIST_HEAD(&sr->all_publ); in tipc_service_create_range()
214 rb_link_node(&sr->tree_node, parent, n); in tipc_service_create_range()
215 rb_insert_color(&sr->tree_node, &sc->ranges); in tipc_service_create_range()
216 return sr; in tipc_service_create_range()
227 struct service_range *sr; in tipc_service_insert_publ() local
231 sr = tipc_service_create_range(sc, lower, upper); in tipc_service_insert_publ()
232 if (!sr) in tipc_service_insert_publ()
235 first = list_empty(&sr->all_publ); in tipc_service_insert_publ()
238 list_for_each_entry(p, &sr->all_publ, all_publ) { in tipc_service_insert_publ()
248 list_add(&p->local_publ, &sr->local_publ); in tipc_service_insert_publ()
249 list_add(&p->all_publ, &sr->all_publ); in tipc_service_insert_publ()
265 static struct publication *tipc_service_remove_publ(struct service_range *sr, in tipc_service_remove_publ() argument
270 list_for_each_entry(p, &sr->all_publ, all_publ) { in tipc_service_remove_publ()
289 struct service_range *sr; in tipc_service_subscribe() local
306 sr = container_of(n, struct service_range, tree_node); in tipc_service_subscribe()
307 if (sr->lower > ns.upper) in tipc_service_subscribe()
309 if (!tipc_sub_check_overlap(&ns, sr->lower, sr->upper)) in tipc_service_subscribe()
313 list_for_each_entry(p, &sr->all_publ, all_publ) { in tipc_service_subscribe()
314 tipc_sub_report_overlap(sub, sr->lower, sr->upper, in tipc_service_subscribe()
369 struct service_range *sr = NULL; in tipc_nametbl_remove_publ() local
377 sr = tipc_service_find_range(sc, lower, upper); in tipc_nametbl_remove_publ()
378 if (!sr) in tipc_nametbl_remove_publ()
380 p = tipc_service_remove_publ(sr, node, key); in tipc_nametbl_remove_publ()
385 last = list_empty(&sr->all_publ); in tipc_nametbl_remove_publ()
392 if (list_empty(&sr->all_publ)) { in tipc_nametbl_remove_publ()
393 rb_erase(&sr->tree_node, &sc->ranges); in tipc_nametbl_remove_publ()
394 kfree(sr); in tipc_nametbl_remove_publ()
428 struct service_range *sr; in tipc_nametbl_translate() local
444 sr = tipc_service_first_range(sc, instance); in tipc_nametbl_translate()
445 if (unlikely(!sr)) in tipc_nametbl_translate()
450 list = &sr->local_publ; in tipc_nametbl_translate()
454 list_move_tail(&p->local_publ, &sr->local_publ); in tipc_nametbl_translate()
455 } else if (legacy && !*dnode && !list_empty(&sr->local_publ)) { in tipc_nametbl_translate()
456 list = &sr->local_publ; in tipc_nametbl_translate()
458 list_move_tail(&p->local_publ, &sr->local_publ); in tipc_nametbl_translate()
460 list = &sr->all_publ; in tipc_nametbl_translate()
462 list_move_tail(&p->all_publ, &sr->all_publ); in tipc_nametbl_translate()
479 struct service_range *sr; in tipc_nametbl_lookup() local
491 sr = tipc_service_first_range(sc, instance); in tipc_nametbl_lookup()
492 if (!sr) in tipc_nametbl_lookup()
495 list_for_each_entry(p, &sr->all_publ, all_publ) { in tipc_nametbl_lookup()
504 list_move_tail(&p->all_publ, &sr->all_publ); in tipc_nametbl_lookup()
517 struct service_range *sr; in tipc_nametbl_mc_lookup() local
530 sr = container_of(n, struct service_range, tree_node); in tipc_nametbl_mc_lookup()
531 if (sr->upper < lower) in tipc_nametbl_mc_lookup()
533 if (sr->lower > upper) in tipc_nametbl_mc_lookup()
535 list_for_each_entry(p, &sr->local_publ, local_publ) { in tipc_nametbl_mc_lookup()
552 struct service_range *sr; in tipc_nametbl_lookup_dst_nodes() local
565 sr = container_of(n, struct service_range, tree_node); in tipc_nametbl_lookup_dst_nodes()
566 if (sr->upper < lower) in tipc_nametbl_lookup_dst_nodes()
568 if (sr->lower > upper) in tipc_nametbl_lookup_dst_nodes()
570 list_for_each_entry(p, &sr->all_publ, all_publ) { in tipc_nametbl_lookup_dst_nodes()
584 struct service_range *sr; in tipc_nametbl_build_group() local
596 sr = container_of(n, struct service_range, tree_node); in tipc_nametbl_build_group()
597 list_for_each_entry(p, &sr->all_publ, all_publ) { in tipc_nametbl_build_group()
757 struct service_range *sr, *tmpr; in tipc_service_delete() local
761 rbtree_postorder_for_each_entry_safe(sr, tmpr, &sc->ranges, tree_node) { in tipc_service_delete()
762 list_for_each_entry_safe(p, tmp, &sr->all_publ, all_publ) { in tipc_service_delete()
763 tipc_service_remove_publ(sr, p->node, p->key); in tipc_service_delete()
766 rb_erase(&sr->tree_node, &sc->ranges); in tipc_service_delete()
767 kfree(sr); in tipc_service_delete()
802 struct service_range *sr, in __tipc_nl_add_nametable_publ() argument
811 list_for_each_entry(p, &sr->all_publ, all_publ) in __tipc_nl_add_nametable_publ()
817 p = list_first_entry(&sr->all_publ, in __tipc_nl_add_nametable_publ()
822 list_for_each_entry_from(p, &sr->all_publ, all_publ) { in __tipc_nl_add_nametable_publ()
841 if (nla_put_u32(msg->skb, TIPC_NLA_PUBL_LOWER, sr->lower)) in __tipc_nl_add_nametable_publ()
843 if (nla_put_u32(msg->skb, TIPC_NLA_PUBL_UPPER, sr->upper)) in __tipc_nl_add_nametable_publ()
876 struct service_range *sr; in __tipc_nl_service_range_list() local
881 sr = container_of(n, struct service_range, tree_node); in __tipc_nl_service_range_list()
882 if (sr->lower < *last_lower) in __tipc_nl_service_range_list()
884 err = __tipc_nl_add_nametable_publ(msg, sc, sr, last_key); in __tipc_nl_service_range_list()
886 *last_lower = sr->lower; in __tipc_nl_service_range_list()