010-falloc.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 52bead95d2957437c691891fcdc49bd6afccdd49 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <[email protected]>
  3. Date: Fri, 12 Apr 2024 18:45:13 +0200
  4. Subject: Create.c: fix uclibc build
  5. Define FALLOC_FL_ZERO_RANGE if needed as FALLOC_FL_ZERO_RANGE is only
  6. defined for aarch64 on uclibc-ng resulting in the following or1k build
  7. failure since commit 577fd10486d8d1472a6b559066f344ac30a3a391:
  8. Create.c: In function 'write_zeroes_fork':
  9. Create.c:155:35: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function)
  10. 155 | if (fallocate(fd, FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE,
  11. | ^~~~~~~~~~~~~~~~~~~~
  12. Fixes:
  13. - http://autobuild.buildroot.org/results/0e04bcdb591ca5642053e1f7e31384f06581e989
  14. Signed-off-by: Fabrice Fontaine <[email protected]>
  15. Signed-off-by: Mariusz Tkaczyk <[email protected]>
  16. ---
  17. Create.c | 4 ++++
  18. 1 file changed, 4 insertions(+)
  19. --- a/Create.c
  20. +++ b/Create.c
  21. @@ -32,6 +32,10 @@
  22. #include <sys/signalfd.h>
  23. #include <sys/wait.h>
  24. +#ifndef FALLOC_FL_ZERO_RANGE
  25. +#define FALLOC_FL_ZERO_RANGE 16
  26. +#endif
  27. +
  28. static int round_size_and_verify(unsigned long long *size, int chunk)
  29. {
  30. if (*size == 0)