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

Function graph_free_vertex

freebsd/kern/kern_lockf.c:2435–2458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2433}
2434
2435static void
2436graph_free_vertex(struct owner_graph *g, struct owner_vertex *v)
2437{
2438 struct owner_vertex *w;
2439 int i;
2440
2441 sx_assert(&lf_owner_graph_lock, SX_XLOCKED);
2442
2443 KASSERT(LIST_EMPTY(&v->v_outedges), ("Freeing vertex with edges"));
2444 KASSERT(LIST_EMPTY(&v->v_inedges), ("Freeing vertex with edges"));
2445
2446 /*
2447 * Remove from the graph's array and close up the gap,
2448 * renumbering the other vertices.
2449 */
2450 for (i = v->v_order + 1; i < g->g_size; i++) {
2451 w = g->g_vertices[i];
2452 w->v_order--;
2453 g->g_vertices[i - 1] = w;
2454 }
2455 g->g_size--;
2456
2457 free(v, M_LOCKF);
2458}
2459
2460static struct owner_graph *
2461graph_init(struct owner_graph *g)

Callers 1

lf_free_lockFunction · 0.85

Calls 1

freeFunction · 0.70

Tested by

no test coverage detected