mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Fallocate space in advance on decompression.
This often can speed up decompression of large files and decreases fragmentation.
This commit is contained in:
parent
fd5a77ac21
commit
cf03cb0c04
3
main.c
3
main.c
|
|
@ -350,6 +350,9 @@ static void decompress_file(void)
|
||||||
failure("Inadequate free space to decompress file, use -f to override.\n");
|
failure("Inadequate free space to decompress file, use -f to override.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unlikely(posix_fallocate(fd_out, 0, expected_size)))
|
||||||
|
failure("Failed to fallocate fd_out in decompress_file\n");
|
||||||
|
|
||||||
fd_hist = open(control.outfile, O_RDONLY);
|
fd_hist = open(control.outfile, O_RDONLY);
|
||||||
if (unlikely(fd_hist == -1))
|
if (unlikely(fd_hist == -1))
|
||||||
fatal("Failed to open history file %s\n", control.outfile);
|
fatal("Failed to open history file %s\n", control.outfile);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue