Files
mesa/src/util
Juston Li 88d074cb8f util/disk_cache: use posix_fallocate() for index files
ftruncate() allocates disk space lazily. If the disk is full and it is
unable to allocate disk space when accesed via mmap(), it will crash
with a SIGBUS.

Switch to posix_fallocate(), which ensures disk space is allocated
otherwise it fails if there isn't enough disk space. The disk cache
won't be enabled in this case.

For normal cases, a small increase in disk usage as the 1.3MB index
file will be fully allocated when initialized now.

fallback to ftruncate() if posix_fallocate() isn't found.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22097>
2023-03-30 01:09:10 +00:00
..
2023-03-24 15:49:25 +00:00
2023-03-26 00:16:26 +00:00
2022-07-07 12:25:05 +00:00
2022-04-22 19:38:52 +00:00
2022-09-29 23:40:18 +00:00
2022-09-29 23:40:18 +00:00
2022-06-02 13:09:16 +00:00
2021-08-14 21:44:32 +00:00
2023-01-19 03:25:55 +00:00
2023-03-05 16:31:51 +00:00
2022-11-14 20:13:20 +00:00
2023-02-22 17:55:40 +00:00
2023-02-22 17:55:40 +00:00
2023-02-12 17:11:16 +00:00
2023-03-26 00:16:26 +00:00
2023-03-26 00:16:26 +00:00
2022-06-02 13:09:16 +00:00
2022-11-04 23:20:02 +00:00
2022-11-04 23:20:02 +00:00
2022-03-09 08:48:59 +00:00
2022-03-09 08:48:59 +00:00
2022-08-04 23:53:49 +00:00
2022-11-24 04:33:07 +00:00
2022-05-17 21:02:24 +00:00
2022-12-17 19:14:12 +00:00
2022-12-17 19:14:12 +00:00
2021-08-14 21:44:32 +00:00