manager_transaction_unlink_job(m, j);
- if (!j->linked)
+ if (!j->installed)
job_free(j);
}
assert(m);
while ((j = hashmap_first(m->transaction_jobs)))
- if (j->linked)
+ if (j->installed)
transaction_delete_job(m, j);
else
job_free(j);
* indirectly a dependency of the anchor job via paths that
* are fully marked as mattering. */
- for (l = j ? j->subject_list : m->transaction_anchor; l; l = l->subject_next) {
+ if (j)
+ l = j->subject_list;
+ else
+ l = m->transaction_anchor;
+
+ LIST_FOREACH(subject, l, l) {
/* This link does not matter */
if (!l->matters)
assert(j);
assert(other);
assert(j->name == other->name);
- assert(!j->linked);
+ assert(!j->installed);
/* Merges 'other' into 'j' and then deletes j. */
/* Patch us in as new owner of the JobDependency objects */
last = NULL;
- for (l = other->subject_list; l; l = l->subject_next) {
+ LIST_FOREACH(subject, l, other->subject_list) {
assert(l->subject == other);
l->subject = j;
last = l;
/* Patch us in as new owner of the JobDependency objects */
last = NULL;
- for (l = other->object_list; l; l = l->object_next) {
+ LIST_FOREACH(object, l, other->object_list) {
assert(l->object == other);
l->object = j;
last = l;
job_type_merge(&t, j->name->meta.job->type); /* Might fail. Which is OK */
while ((k = j->transaction_next)) {
- if (j->linked) {
+ if (j->installed) {
transaction_merge_and_delete_job(m, k, j, t);
j = k;
} else
for (k = from; k; k = (k->generation == generation ? k->marker : NULL)) {
- if (!k->linked &&
+ if (!k->installed &&
!name_matters_to_anchor(k->name, k)) {
/* Ok, we can drop this one, so let's
* do so. */
assert(!j->transaction_prev);
assert(!j->transaction_next);
- if (j->linked)
+ if (j->installed)
continue;
if ((r = hashmap_put(m->jobs, UINT32_TO_PTR(j->id), j)) < 0)
}
while ((j = hashmap_steal_first(m->transaction_jobs))) {
- if (j->linked)
+ if (j->installed)
continue;
if (j->name->meta.job)
job_free(j->name->meta.job);
j->name->meta.job = j;
- j->linked = true;
+ j->installed = true;
/* We're fully installed. Now let's free data we don't
* need anymore. */
rollback:
HASHMAP_FOREACH(j, m->transaction_jobs, i) {
- if (j->linked)
+ if (j->installed)
continue;
hashmap_remove(m->jobs, UINT32_TO_PTR(j->id));
* tries to load its data until the queue is empty */
while ((meta = m->load_queue)) {
- assert(meta->linked);
assert(meta->in_load_queue);
name_load(NAME(meta));
return r;
}
- if ((r = name_link(ret)) < 0) {
- name_free(ret);
- return r;
- }
-
- /* At this point the new entry is created and linked. However
- * not loaded. Now load this entry and all its dependencies
- * recursively */
-
+ name_add_to_load_queue(ret);
dispatch_load_queue(m);
*_ret = ret;
m->dispatching_run_queue = true;
while ((j = m->run_queue)) {
- assert(j->linked);
+ assert(j->installed);
assert(j->in_run_queue);
job_run_and_invalidate(j);