opnsense-src/usr.sbin/makefs
Boris Lytochkin 9ce29249ec makefs: Calculate indirect block count properly for large files on ffs
When building an ffs image containing large file(s), space requirements
were calculated incorrectly yielding a bigger image than necessary.
The reason is that amount of indirect blocks estimation was done wrong:

- single indirect block was treated as it can hold just 12 data blocks
- nested indirect blocks were not taken into account at all

Add support for indirect blocks and fix another tiny bug with
underestimated space requirement for files with size between
(UFS_NDADDR-1)*blksz+fragsz ... (UFS_NDADDR)*blksz requesting N>1
fragments instead of a whole block.

Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D52120
2025-08-27 15:18:50 -04:00
..
cd9660 makefs: Initialize cd9660 inode map only once 2025-03-01 08:35:15 -05:00
ffs makefs: Ensure that FFS superblocks are reproducible 2025-05-08 15:49:53 +00:00
msdos msdosfs: Add _WANT_MSDOSFS_INTERNALS to replace MAKEFS in headers 2025-06-16 22:33:18 +01:00
sys Fix makefs bootstrap after d485c77f20 2021-02-22 17:55:45 +00:00
tests makefs/zfs tests: Run in parallel 2025-07-21 14:57:58 +00:00
zfs makefs: zfs uberblock location is calculated wrong 2025-08-15 07:55:49 +03:00
cd9660.c makefs: Fix cd9660 duplicate directory names 2024-12-30 14:48:44 -05:00
cd9660.h makefs: Make cd9660 Rock Ridge inodes reproducible 2025-02-28 15:34:52 -05:00
ffs.c makefs: Calculate indirect block count properly for large files on ffs 2025-08-27 15:18:50 -04:00
ffs.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
Makefile src: Use gnu17 as the default C standard for userland instead of gnu99 2025-02-11 09:16:25 -05:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend.host Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend.options Build host tools on non-FreeBSD host with DIRDEPS_BUILD 2023-04-22 13:13:22 -07:00
makefs.8 makefs/zfs: Allow the user to specify the pool GUID 2025-07-21 14:57:58 +00:00
makefs.c makefs: Honor -T timestamps when creating images from mtree manifests 2025-05-20 11:50:22 +02:00
makefs.h makefs: Honor -T timestamps when creating images from mtree manifests 2025-05-20 11:50:22 +02:00
msdos.c usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
msdos.h Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
mtree.c makefs: Honor -T timestamps when creating images from mtree manifests 2025-05-20 11:50:22 +02:00
walk.c makefs: Honor -T timestamps when creating images from mtree manifests 2025-05-20 11:50:22 +02:00
zfs.c makefs: zfs uberblock location is calculated wrong 2025-08-15 07:55:49 +03:00