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

Function lf_update_dependancies

freebsd/kern/kern_lockf.c:1147–1166  ·  view source on GitHub ↗

* 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' */

Source from the content-addressed store, hash-verified

1145 * unblocked are added to 'granted'
1146 */
1147static void
1148lf_update_dependancies(struct lockf *state, struct lockf_entry *lock, int all,
1149 struct lockf_entry_list *granted)
1150{
1151 struct lockf_edge *e, *ne;
1152 struct lockf_entry *deplock;
1153
1154 LIST_FOREACH_SAFE(e, &lock->lf_inedges, le_inlink, ne) {
1155 deplock = e->le_from;
1156 if (all || !lf_blocks(lock, deplock)) {
1157 sx_xlock(&lf_owner_graph_lock);
1158 lf_remove_edge(e);
1159 sx_xunlock(&lf_owner_graph_lock);
1160 if (LIST_EMPTY(&deplock->lf_outedges)) {
1161 lf_wakeup_lock(state, deplock);
1162 LIST_INSERT_HEAD(granted, deplock, lf_link);
1163 }
1164 }
1165 }
1166}
1167
1168/*
1169 * Set the start of an existing active lock, updating dependencies and

Callers 4

lf_set_startFunction · 0.85
lf_set_endFunction · 0.85
lf_activate_lockFunction · 0.85
lf_cancel_lockFunction · 0.85

Calls 3

lf_blocksFunction · 0.85
lf_remove_edgeFunction · 0.85
lf_wakeup_lockFunction · 0.85

Tested by

no test coverage detected