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

Function lf_insert_lock

freebsd/kern/kern_lockf.c:1093–1112  ·  view source on GitHub ↗

* Insert lock into the active list, keeping list entries ordered by * increasing values of lf_start. */

Source from the content-addressed store, hash-verified

1091 * increasing values of lf_start.
1092 */
1093static void
1094lf_insert_lock(struct lockf *state, struct lockf_entry *lock)
1095{
1096 struct lockf_entry *lf, *lfprev;
1097
1098 if (LIST_EMPTY(&state->ls_active)) {
1099 LIST_INSERT_HEAD(&state->ls_active, lock, lf_link);
1100 return;
1101 }
1102
1103 lfprev = NULL;
1104 LIST_FOREACH(lf, &state->ls_active, lf_link) {
1105 if (lf->lf_start > lock->lf_start) {
1106 LIST_INSERT_BEFORE(lf, lock, lf_link);
1107 return;
1108 }
1109 lfprev = lf;
1110 }
1111 LIST_INSERT_AFTER(lfprev, lock, lf_link);
1112}
1113
1114/*
1115 * Wake up a sleeping lock and remove it from the pending list now

Callers 3

lf_set_startFunction · 0.85
lf_activate_lockFunction · 0.85
lf_splitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected