2 Commits
Author SHA1 Message Date
Ernesto A. Fernández 0aa9f9a32d apfsprogs: simplify formula for ip fq node limit
The formula for ip_fq_node_limit() currently considers containers with
fewer than 376 chunks as a special case, even though they follow the
same linear function as the others. The intention was to avoid dealing
with negative numbers, since all the variables are unsigned and rounding
behaves differently. Instead, rearrange the linear formula to avoid
these problems.

Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
2021-05-07 17:21:49 -03:00
Ernesto A. Fernández e27cef6704 apfsprogs: deal with maximum size of free queues
The Apple implementation refuses to mount any container that doesn't
have a specific tree node limit set in the free queues. It took me a
while, but I think I figured out the formulas they use. Implement them
in a new common library file, and use it both for the fsck to check the
value and for the mkfs to set it correctly in new filesystems.

Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
2021-05-06 22:55:53 -03:00