MCPcopy Create free account
hub / github.com/F-Stack/f-stack / graph_check

Function graph_check

freebsd/kern/kern_lockf.c:2069–2089  ·  view source on GitHub ↗

* Perform consistency checks on the graph. Make sure the values of * v_order are correct. If checkorder is non-zero, check no vertex can * reach any other vertex with a smaller order. */

Source from the content-addressed store, hash-verified

2067 * reach any other vertex with a smaller order.
2068 */
2069static void
2070graph_check(struct owner_graph *g, int checkorder)
2071{
2072 int i, j;
2073
2074 for (i = 0; i < g->g_size; i++) {
2075 if (!g->g_vertices[i]->v_owner)
2076 continue;
2077 KASSERT(g->g_vertices[i]->v_order == i,
2078 ("lock graph vertices disordered"));
2079 if (checkorder) {
2080 for (j = 0; j < i; j++) {
2081 if (!g->g_vertices[j]->v_owner)
2082 continue;
2083 KASSERT(!graph_reaches(g->g_vertices[i],
2084 g->g_vertices[j], NULL),
2085 ("lock graph vertices disordered"));
2086 }
2087 }
2088 }
2089}
2090
2091static void
2092graph_print_vertices(struct owner_vertex_list *set)

Callers 1

graph_add_edgeFunction · 0.85

Calls 1

graph_reachesFunction · 0.85

Tested by

no test coverage detected