* 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. */
| 2067 | * reach any other vertex with a smaller order. |
| 2068 | */ |
| 2069 | static void |
| 2070 | graph_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 | |
| 2091 | static void |
| 2092 | graph_print_vertices(struct owner_vertex_list *set) |
no test coverage detected