return p->suppressing ? MIN(p->padding_max, p->suppressing->padding_max) : p->padding_max;
}
-static uint64_t partition_min_size_with_padding(Context *context, const Partition *p) {
+static uint64_t partition_min_size_with_padding(const Context *context, const Partition *p) {
uint64_t sz;
/* Calculate the disk space we need for this partition plus any free space coming after it. This
return a->size - a->allocated;
}
-static uint64_t free_area_current_end(Context *context, const FreeArea *a) {
+static uint64_t free_area_current_end(const Context *context, const FreeArea *a) {
assert(context);
assert(a);
return round_up_size(a->after->offset + a->after->current_size, context->grain_size) + free_area_available(a);
}
-static uint64_t free_area_min_end(Context *context, const FreeArea *a) {
+static uint64_t free_area_min_end(const Context *context, const FreeArea *a) {
assert(context);
assert(a);
return round_up_size(a->after->offset + partition_min_size_with_padding(context, a->after), context->grain_size);
}
-static uint64_t free_area_available_for_new_partitions(Context *context, const FreeArea *a) {
+static uint64_t free_area_available_for_new_partitions(const Context *context, const FreeArea *a) {
assert(context);
assert(a);
free_area_available_for_new_partitions(context, *b));
}
-static uint64_t charge_size(Context *context, uint64_t total, uint64_t amount) {
+static uint64_t charge_size(const Context *context, uint64_t total, uint64_t amount) {
assert(context);
/* Subtract the specified amount from total, rounding up to multiple of 4K if there's room */
assert(amount <= total);
return p->suppressing ? p->suppressing->padding_weight : p->padding_weight;
}
-static int context_sum_weights(Context *context, FreeArea *a, uint64_t *ret) {
+static int context_sum_weights(const Context *context, const FreeArea *a, uint64_t *ret) {
uint64_t weight_sum = 0;
assert(context);
} GrowPartitionPhase;
static bool context_grow_partitions_phase(
- Context *context,
- FreeArea *a,
+ const Context *context,
+ const FreeArea *a,
GrowPartitionPhase phase,
uint64_t *span,
uint64_t *weight_sum) {
return 0;
}
-static bool partition_defer(Context *c, const Partition *p) {
+static bool partition_defer(const Context *c, const Partition *p) {
assert(c);
assert(p);