From: Jonas Dreßler Date: Mon, 13 Jul 2026 14:37:56 +0000 (+0200) Subject: repart: Make use of partitions list being ordered by offsets while looping X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F42969%2Fhead;p=thirdparty%2Fsystemd.git repart: Make use of partitions list being ordered by offsets while looping Let's do the same thing we did above with the last commit here too and make use of the partitions list being ordered by physical offsets. This makes the code a little simpler. --- diff --git a/src/repart/repart.c b/src/repart/repart.c index d245cab539f..bc6df85b26f 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -1717,15 +1717,12 @@ static int context_grow_partitions_on_free_area(Context *context, FreeArea *a) { Partition *last_partition = NULL; LIST_FOREACH(partitions, p, context->partitions) - if (p->allocated_to_area == a) + if (p->allocated_to_area == a || p->padding_area == a) last_partition = p; if (last_partition) { assert(last_partition->new_padding != UINT64_MAX); last_partition->new_padding += round_down_size(span, context->grain_size); - } else if (a->after) { - assert(a->after->new_padding != UINT64_MAX); - a->after->new_padding += round_down_size(span, context->grain_size); } }