Skip to content

Commit

Permalink
Linux 5.19 compat: zap_flags_t conflict
Browse files Browse the repository at this point in the history
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 openzfs#13515
  • Loading branch information
behlendorf authored and Ryan Moeller committed Jun 27, 2022
1 parent d3b461c commit 4cb34e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/sys/zap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4cb34e2

Please sign in to comment.