FreeBSD/sys/kern/kern_lockf.c
/*
 * Calculate the sub-set of vertices v from the affected region [y..x]
 * where v is reachable from y. Return -1 if a loop was detected
 * (i.e. x is reachable from y, otherwise the number of vertices in
 * this subset.
 */
Calculate the sub-set of vertices v from the affected region [y..x]
where v is reachable from y. Return -1 if a loop was detected
(i.e. x is reachable from y, otherwise the number of vertices in
this subset.
Calculate the sub - set of vertices v from the affected region [ y .. x ] where v is reachable from y . Return - 1 if a loop was detected ( i . e . x is reachable from y otherwise the number of vertices in this subset .
static int
graph_delta_forward(struct owner_graph *g, struct owner_vertex *x,
    struct owner_vertex *y, struct owner_vertex_list *delta)
{
	uint32_t gen;
	struct owner_vertex *v;
	struct owner_edge *e;
	int n;
	TAILQ_INIT(delta);
	TAILQ_INSERT_TAIL(delta, y, v_link);
	v = y;
	n = 1;
	gen = g->g_gen;
	while (v) {
		LIST_FOREACH(e, &v->v_outedges, e_outlink) {
			if (e->e_to == x)
				return -1;
			if (e->e_to->v_order < x->v_order
			    && e->e_to->v_gen != gen) {
				e->e_to->v_gen = gen;
				TAILQ_INSERT_TAIL(delta, e->e_to, v_link);
				n++;
			}
		}
		v = TAILQ_NEXT(v, v_link);
	}
	return (n);
}
static int graph_delta_forward ( struct owner_graph * g , struct owner_vertex * x , struct owner_vertex * y , struct owner_vertex_list * delta ) { uint32_t gen ; struct owner_vertex * v ; struct owner_edge * e ; int n ; TAILQ_INIT ( delta ) ; TAILQ_INSERT_TAIL ( delta , y , v_link ) ; v = y ; n = 1 ; gen = g -> g_gen ; while ( v ) { LIST_FOREACH ( e , & v -> v_outedges , e_outlink ) { if ( e -> e_to == x ) return -1 ; if ( e -> e_to -> v_order < x -> v_order && e -> e_to -> v_gen != gen ) { e -> e_to -> v_gen = gen ; TAILQ_INSERT_TAIL ( delta , e -> e_to , v_link ) ; n ++ ; } } v = TAILQ_NEXT ( v , v_link ) ; } return ( n ) ; }
Calculate the sub-set of vertices v from the affected region [y..x]
 where v is reachable from y.
Calculate the sub - set of vertices v from the affected region [ y .. x ] where v is reachable from y .
/*
	 * We start with a set containing just y. Then for each vertex
	 * v in the set so far unprocessed, we add each vertex that v
	 * has an out-edge to and that is within the affected region
	 * [y..x]. If we see the vertex x on our travels, stop
	 * immediately.
	 */