]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Linux 5.19 compat: zap_flags_t conflict
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 27 May 2022 22:56:05 +0000 (15:56 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 31 May 2022 19:04:39 +0000 (12:04 -0700)
As of the Linux 5.19 kernel an identically named zap_flags_t typedef
is declared in the include/linux/mm_types.h linux header.  Sadly,
the inclusion of this header cannot be easily avoided.  To resolve
the conflict a #define is used to remap the name in the OpenZFS
sources when building against the Linux kernel.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13515

include/sys/zap.h

index b19b4643879c93d650e81ae7ecff20380232dcca..fd7a3a1599bc3fb136cce3de80f6385c3813cd18 100644 (file)
@@ -110,7 +110,12 @@ typedef enum zap_flags {
         * already randomly distributed.
         */
        ZAP_FLAG_PRE_HASHED_KEY = 1 << 2,
+#if defined(__linux__) && defined(_KERNEL)
+} zfs_zap_flags_t;
+#define        zap_flags_t     zfs_zap_flags_t
+#else
 } zap_flags_t;
+#endif
 
 /*
  * Create a new zapobj with no attributes and return its object number.