* 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' */
| 1145 | * unblocked are added to 'granted' |
| 1146 | */ |
| 1147 | static void |
| 1148 | lf_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 |
no test coverage detected