0002-basic-add-bcachefs-magic.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From 48c1cd62de0339722fd3b72ef86aaaf1c38ff3dd Mon Sep 17 00:00:00 2001
  2. From: Chris Packham <chris.packham@alliedtelesis.co.nz>
  3. Date: Fri, 31 May 2024 09:51:38 +1200
  4. Subject: [PATCH] basic: Add BCACHEFS magic
  5. Import magic.h from Linux 6.9 to get the definition of
  6. BCACHEFS_SUPER_MAGIC. Update filesystems-gperf.gperf to add knowledge of
  7. bcachefs.
  8. This fixes the following error building against a bleeding edge kernel.
  9. ```
  10. src/basic/meson.build:234:8: ERROR: Problem encountered: Unknown filesystems defined in kernel headers:
  11. Filesystem found in kernel header but not in filesystems-gperf.gperf: BCACHEFS_SUPER_MAGIC
  12. ```
  13. Upstream: https://github.com/systemd/systemd/commit/201148b08de65de004d10679a8c3d201cc08fb28
  14. Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
  15. ---
  16. src/basic/filesystems-gperf.gperf | 1 +
  17. src/basic/missing_magic.h | 7 +++++++
  18. 2 files changed, 8 insertions(+)
  19. diff --git a/src/basic/filesystems-gperf.gperf b/src/basic/filesystems-gperf.gperf
  20. index 1cd66b5a5f..c82fe98227 100644
  21. --- a/src/basic/filesystems-gperf.gperf
  22. +++ b/src/basic/filesystems-gperf.gperf
  23. @@ -28,6 +28,7 @@ afs, {AFS_FS_MAGIC, AFS_SUPER_MAGIC}
  24. anon_inodefs, {ANON_INODE_FS_MAGIC}
  25. autofs, {AUTOFS_SUPER_MAGIC}
  26. balloon-kvm, {BALLOON_KVM_MAGIC}
  27. +bcachefs, {BCACHEFS_SUPER_MAGIC}
  28. bdev, {BDEVFS_MAGIC}
  29. binder, {BINDERFS_SUPER_MAGIC}
  30. binfmt_misc, {BINFMTFS_MAGIC}
  31. diff --git a/src/basic/missing_magic.h b/src/basic/missing_magic.h
  32. index 82d71c8ad1..c8ecf44357 100644
  33. --- a/src/basic/missing_magic.h
  34. +++ b/src/basic/missing_magic.h
  35. @@ -197,3 +197,10 @@
  36. #ifndef NTFS3_SUPER_MAGIC
  37. #define NTFS3_SUPER_MAGIC 0x7366746e
  38. #endif
  39. +
  40. +/* Added in Linux commit e2f48c48090dea172c0c571101041de64634dae5. Remove when next sync'd */
  41. +#ifndef BCACHEFS_SUPER_MAGIC
  42. +# define BCACHEFS_SUPER_MAGIC 0xca451a4e
  43. +#else
  44. +assert_cc(BCACHEFS_SUPER_MAGIC == 0xca451a4e);
  45. +#endif
  46. --
  47. 2.47.0