Merge pull request #3216 from setarcos/loongarch

test: fix incorrect hole count reporting on loongarch64
(cherry picked from commit 983f8da4be)
This commit is contained in:
Dustin L. Howett authored and Martin Matuska committed 2026-07-26 20:14:17 +02:00
1 parent bca61a0d8d
commit 97b636b573
1 file changed
+8 -2
+8 -2
View File
@@ -73,10 +73,16 @@ static void create_sparse_file(const char *, const struct sparse *);
/* A few data points:
* = ZFS on FreeBSD needs this to be at least 200kB
* = macOS APFS needs this to be at least 4096x4097 bytes
* = Linux tmpfs on 16KB-page architectures (like LoongArch64) uses
* 32MiB Transparent Huge Pages (THP). If a hole is exactly the
* size of a THP, the data blocks on either side can end up in
* adjacent physical folios, causing SEEK_HOLE to report the range
* as contiguous data.
*
* 32MiB here is bigger than either of the above.
* 64MiB here is enough to ensure a hole exists between THP folios on all
* common architectures.
*/
#define MIN_HOLE (32 * 1024UL * 1024UL)
#define MIN_HOLE (64 * 1024UL * 1024UL)
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <winioctl.h>