FreeBSD/sys/kern/kern_lockf.c
/*
 * Re-check all dependent locks and remove edges to locks that we no
 * longer block. If 'all' is non-zero, the lock has been removed and
 * we must remove all the dependencies, otherwise it has simply been
 * reduced but remains active. Any pending locks which have been been
 * unblocked are added to 'granted'
 */
Re-check all dependent locks and remove edges to locks that we no
longer block. If 'all' is non-zero, the lock has been removed and
we must remove all the dependencies, otherwise it has simply been
reduced but remains active. Any pending locks which have been been
unblocked are added to 'granted'
Re - check all dependent locks and remove edges to locks that we no longer block . If ' all ' is non - zero the lock has been removed and we must remove all the dependencies otherwise it has simply been reduced but remains active . Any pending locks which have been been unblocked are added to ' granted '
static void
lf_update_dependancies(struct lockf *state, struct lockf_entry *lock, int all,
	struct lockf_entry_list *granted)
{
	struct lockf_edge *e, *ne;
	struct lockf_entry *deplock;
	LIST_FOREACH_SAFE(e, &lock->lf_inedges, le_inlink, ne) {
		deplock = e->le_from;
		if (all || !lf_blocks(lock, deplock)) {
			sx_xlock(&lf_owner_graph_lock);
			lf_remove_edge(e);
			sx_xunlock(&lf_owner_graph_lock);
			if (LIST_EMPTY(&deplock->lf_outedges)) {
				lf_wakeup_lock(state, deplock);
				LIST_INSERT_HEAD(granted, deplock, lf_link);
			}
		}
	}
}
static void lf_update_dependancies ( struct lockf * state , struct lockf_entry * lock , int all , struct lockf_entry_list * granted ) { struct lockf_edge * e , * ne ; struct lockf_entry * deplock ; LIST_FOREACH_SAFE ( e , & lock -> lf_inedges , le_inlink , ne ) { deplock = e -> le_from ; if ( all || ! lf_blocks ( lock , deplock ) ) { sx_xlock ( & lf_owner_graph_lock ) ; lf_remove_edge ( e ) ; sx_xunlock ( & lf_owner_graph_lock ) ; if ( LIST_EMPTY ( & deplock -> lf_outedges ) ) { lf_wakeup_lock ( state , deplock ) ; LIST_INSERT_HEAD ( granted , deplock , lf_link ) ; } } } }
Re-check all dependent locks and remove edges to locks that we no
 longer block.
Re - check all dependent locks and remove edges to locks that we no longer block .