opnsense-src/usr.sbin/makefs
Warner Losh 3a60f9c605 makefs: make msdos creation go fast
Add missing brelse(bp). Without it the cache grows and we have a n^2
lookup.  I'm not entirely sure why we read the block before we write it
back out, since the only side effect of that is to allocate memory,
clear the memory, read it in from disk, throw it away with the contents
of the file being written out. We likely should just do a getblk() here
instead, but even with all that, this takes the time it takes to create
a 150MB msdos fs image down from 5 minutes to 30 seconds.

Old: 317.663u 0.685s 5:18.34 100.0%	198+360k 0+19io 1009pf+0w
New: 7.330u 23.841s 0:31.17 100.0%	198+360k 0+250522io 4pf+0w

See code review for how we got this. tl;dr: netbsd move brelse
into bwrite and we picked up msdos code after that, but not the
move. That change should be picked up later.

Sponsored by:		Netflix
Reviewed by:		emaste
MFC After:		1 day (13.2 is coming fast)
Differential Revision:	https://reviews.freebsd.org/D39025
Approved by:		re@ (cperciva)

(cherry picked from commit 370e009188)
(cherry picked from commit aa1e6a4f4c28c7051ee9431ecb7802309cc1bf96)
2023-03-15 17:14:12 -06:00
..
cd9660 makefs: whitespace cleanup (remove space before tab) 2022-10-01 20:37:18 -04:00
ffs ufs: Rework shortlink handling to avoid subobject overflows 2023-01-24 14:49:19 -07:00
msdos makefs: make msdos creation go fast 2023-03-15 17:14:12 -06:00
tests makefs: fix calculation of file sizes 2022-06-18 08:17:23 -06:00
cd9660.c makefs: whitespace cleanup (remove space before tab) 2022-10-01 20:37:18 -04:00
cd9660.h makefs: whitespace cleanup (remove space before tab) 2022-10-01 20:37:18 -04:00
ffs.c ufs: Rework shortlink handling to avoid subobject overflows 2023-01-24 14:49:19 -07:00
ffs.h Allocate extra inodes in makefs when leaving free space in UFS images. 2021-04-26 21:08:48 -04:00
Makefile makefs: Fix warnings and reset WARNS to the default 2022-05-24 09:51:36 -04:00
Makefile.depend Update Makefile.depend files 2019-12-11 17:37:53 +00:00
makefs.8 makefs: sort cd9660 sysid entries in man page 2022-06-16 08:49:43 -04:00
makefs.c makefs: whitespace cleanup (remove space before tab) 2022-10-01 20:37:18 -04:00
makefs.h makefs: whitespace cleanup (remove space before tab) 2022-10-01 20:37:18 -04:00
msdos.c Fix contents= being ignored in msdosfs makefs mtree 2019-11-15 18:34:23 +00:00
msdos.h Properly update FSInfo block after generation. 2019-08-23 05:23:45 +00:00
mtree.c makefs: Ignore the "tags" keyword in mtree manifests 2021-04-06 09:07:24 -04:00
walk.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00