Skip to content

Conversation

@chungy
Copy link
Contributor

@chungy chungy commented Sep 3, 2024

Summary

Instead of writing out disk blocks slowly across the entire volume, just use the ftruncate function to create a file instantly at the desired size.

Depending on file system, this can either result in identical results to the old code just faster (eg: ZFS and btrfs with compression enabled), sparse files (most native Unix file systems without compression, eg ext4 and UFS), or a full non-sparse file like before (creating an image on FAT and exFAT).

Checklist

Instead of writing out disk blocks slowly across the entire volume,
just use the ftruncate function to create a file instantly at the
desired size.

Depending on file system, this can either result in identical results
to the old code just faster (eg: ZFS and btrfs with compression
enabled), sparse files (most native Unix file systems without
compression, eg ext4 and UFS), or a full non-sparse file like before
(creating an image on FAT).
@OBattler OBattler merged commit 19a2721 into 86Box:master Sep 3, 2024
@chungy chungy deleted the ftruncate branch September 4, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants