0001-src-basic-missing_loop.h-fix-missing-LOOP_SET_BLOCK_.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From e358793a796f8c742af4ea3f4fe398731ca46649 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= <raphael.melotte@mind.be>
  3. Date: Fri, 14 Jun 2024 14:37:29 +0200
  4. Subject: [PATCH] src/basic/missing_loop.h: fix missing LOOP_SET_BLOCK_SIZE
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Builds with kernels headers < 4.14 fail with:
  9. ../src/shared/loop-util.c: In function ‘loop_configure_fallback’:
  10. ../src/shared/loop-util.c:237:31: error: ‘LOOP_SET_BLOCK_SIZE’ undeclared (first use in this function); did you mean ‘LOOP_SET_DIRECT_IO’?
  11. if (ioctl(fd, LOOP_SET_BLOCK_SIZE, (unsigned long) c->block_size) < 0)
  12. ^~~~~~~~~~~~~~~~~~~
  13. LOOP_SET_DIRECT_IO
  14. Fixes: https://github.com/systemd/systemd/issues/33341
  15. Upstream: https://github.com/systemd/systemd/commit/56ab1c54497d9fac74380ff9e11aaf931a917d2b
  16. Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
  17. ---
  18. src/basic/missing_loop.h | 4 ++++
  19. 1 file changed, 4 insertions(+)
  20. diff --git a/src/basic/missing_loop.h b/src/basic/missing_loop.h
  21. index 7141544b64..b1505f678b 100644
  22. --- a/src/basic/missing_loop.h
  23. +++ b/src/basic/missing_loop.h
  24. @@ -22,3 +22,7 @@ struct loop_config {
  25. #ifndef LOOP_SET_STATUS_SETTABLE_FLAGS
  26. #define LOOP_SET_STATUS_SETTABLE_FLAGS (LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN | LO_FLAGS_DIRECT_IO)
  27. #endif
  28. +
  29. +#ifndef LOOP_SET_BLOCK_SIZE
  30. +# define LOOP_SET_BLOCK_SIZE 0x4C09
  31. +#endif
  32. --
  33. 2.25.1