Lines Matching refs:vertex
119 return unix_sk(edge->successor->listener)->vertex; in unix_edge_successor()
121 return edge->successor->vertex; in unix_edge_successor()
132 static void unix_update_graph(struct unix_vertex *vertex) in unix_update_graph() argument
137 if (!vertex) in unix_update_graph()
156 struct unix_vertex *vertex = edge->predecessor->vertex; in unix_add_edge() local
158 if (!vertex) { in unix_add_edge()
159 vertex = list_first_entry(&fpl->vertices, typeof(*vertex), entry); in unix_add_edge()
160 vertex->index = unix_vertex_unvisited_index; in unix_add_edge()
161 vertex->scc_index = ++unix_vertex_max_scc_index; in unix_add_edge()
162 vertex->out_degree = 0; in unix_add_edge()
163 INIT_LIST_HEAD(&vertex->edges); in unix_add_edge()
164 INIT_LIST_HEAD(&vertex->scc_entry); in unix_add_edge()
166 list_move_tail(&vertex->entry, &unix_unvisited_vertices); in unix_add_edge()
167 edge->predecessor->vertex = vertex; in unix_add_edge()
170 vertex->out_degree++; in unix_add_edge()
171 list_add_tail(&edge->vertex_entry, &vertex->edges); in unix_add_edge()
178 struct unix_vertex *vertex = edge->predecessor->vertex; in unix_del_edge() local
184 vertex->out_degree--; in unix_del_edge()
186 if (!vertex->out_degree) { in unix_del_edge()
187 edge->predecessor->vertex = NULL; in unix_del_edge()
188 list_move_tail(&vertex->entry, &fpl->vertices); in unix_del_edge()
194 struct unix_vertex *vertex, *next_vertex; in unix_free_vertices() local
196 list_for_each_entry_safe(vertex, next_vertex, &fpl->vertices, entry) { in unix_free_vertices()
197 list_del(&vertex->entry); in unix_free_vertices()
198 kfree(vertex); in unix_free_vertices()
276 unix_update_graph(unix_sk(receiver->listener)->vertex); in unix_update_edges()
284 struct unix_vertex *vertex; in unix_prepare_fpl() local
291 vertex = kmalloc_obj(*vertex); in unix_prepare_fpl()
292 if (!vertex) in unix_prepare_fpl()
295 list_add(&vertex->entry, &fpl->vertices); in unix_prepare_fpl()
340 static bool unix_vertex_dead(struct unix_vertex *vertex) in unix_vertex_dead() argument
346 list_for_each_entry(edge, &vertex->edges, vertex_entry) { in unix_vertex_dead()
356 if (next_vertex->scc_index != vertex->scc_index) in unix_vertex_dead()
362 edge = list_first_entry(&vertex->edges, typeof(*edge), vertex_entry); in unix_vertex_dead()
367 if (total_ref != vertex->out_degree) in unix_vertex_dead()
378 struct unix_vertex *vertex; in unix_scc_dead() local
384 list_for_each_entry_reverse(vertex, scc, scc_entry) { in unix_scc_dead()
386 list_move_tail(&vertex->entry, &unix_visited_vertices); in unix_scc_dead()
390 vertex->index = unix_vertex_grouped_index; in unix_scc_dead()
393 scc_dead = unix_vertex_dead(vertex); in unix_scc_dead()
405 struct unix_vertex *vertex; in unix_collect_skb() local
407 list_for_each_entry_reverse(vertex, scc, scc_entry) { in unix_collect_skb()
412 edge = list_first_entry(&vertex->edges, typeof(*edge), vertex_entry); in unix_collect_skb()
438 struct unix_vertex *vertex; in unix_scc_cyclic() local
445 vertex = list_first_entry(scc, typeof(*vertex), scc_entry); in unix_scc_cyclic()
448 list_for_each_entry(edge, &vertex->edges, vertex_entry) { in unix_scc_cyclic()
449 if (unix_edge_successor(edge) == vertex) in unix_scc_cyclic()
456 static unsigned long __unix_walk_scc(struct unix_vertex *vertex, in __unix_walk_scc() argument
470 list_add(&vertex->scc_entry, &vertex_stack); in __unix_walk_scc()
472 vertex->index = *last_index; in __unix_walk_scc()
473 vertex->scc_index = *last_index; in __unix_walk_scc()
477 list_for_each_entry(edge, &vertex->edges, vertex_entry) { in __unix_walk_scc()
491 vertex = next_vertex; in __unix_walk_scc()
501 next_vertex = vertex; in __unix_walk_scc()
502 vertex = edge->predecessor->vertex; in __unix_walk_scc()
508 vertex->scc_index = min(vertex->scc_index, next_vertex->scc_index); in __unix_walk_scc()
516 vertex->scc_index = min(vertex->scc_index, next_vertex->scc_index); in __unix_walk_scc()
522 if (vertex->index == vertex->scc_index) { in __unix_walk_scc()
530 __list_cut_position(&scc, &vertex_stack, &vertex->scc_entry); in __unix_walk_scc()
535 if (unix_vertex_max_scc_index < vertex->scc_index) in __unix_walk_scc()
536 unix_vertex_max_scc_index = vertex->scc_index; in __unix_walk_scc()
565 struct unix_vertex *vertex; in unix_walk_scc() local
567 vertex = list_first_entry(&unix_unvisited_vertices, typeof(*vertex), entry); in unix_walk_scc()
568 cyclic_sccs += __unix_walk_scc(vertex, &last_index, hitlist); in unix_walk_scc()
584 struct unix_vertex *vertex; in unix_walk_scc_fast() local
587 vertex = list_first_entry(&unix_unvisited_vertices, typeof(*vertex), entry); in unix_walk_scc_fast()
588 list_add(&scc, &vertex->scc_entry); in unix_walk_scc_fast()