diff options
author | Alan Somers <asomers@FreeBSD.org> | 2022-05-16 22:32:10 +0000 |
---|---|---|
committer | Alan Somers <asomers@FreeBSD.org> | 2022-05-16 22:32:10 +0000 |
commit | ecdc04d006de93eb343ce3b77208abd937d4f8ac (patch) | |
tree | 864fa322c99a9d3bc34dee1d7263dd28a754708b /sbin/shutdown | |
parent | c1e0431c2202faa178642c8b54e545df3ed44f5f (diff) | |
download | src-main.tar.gz src-main.zip |
When a new FS image is created we need to calculate how much space each
file is going to consume.
Fix two bugs in that logic:
1) Count the space needed for indirect blocks for large files.
1) Normally the trailing data of a file is written to a block of frag
size, 4 kB by default.
However for files that use indirect blocks a full block is allocated,
32kB by default. Take that into account.
Adjust size calculations to match what is done in ffs_mkfs routine:
* Depending on the UFS version the superblock is stored at a different
offset. Take that into account.
* Add the cylinder group block size.
* All of the above has to be aligned to the block size.
Finally, Remove "ncg" variable. It's always 1 and it was used to
multiply stuff.
PR: 229929
Reviewed by: mckusick
MFC after: 2 weeks
Sponsored by: Semihalf
Submitted by: Kornel Dulęba <mindal@semihalf.com>
Differential Revision: https://reviews.freebsd.org/D35131
Differential Revision: https://reviews.freebsd.org/D35132
Diffstat (limited to 'sbin/shutdown')
0 files changed, 0 insertions, 0 deletions