HomeFreeBSD

Linux 6.10: work harder to avoid kmem_cache_alloc reuse

Description

Linux 6.10: work harder to avoid kmem_cache_alloc reuse

Linux 6.10 change kmem_cache_alloc to be a macro, rather than a
function, such that the old #undef for it in spl-kmem-cache.c would
remove its definition completely, breaking the build.

This inverts the model used before. Rather than always defining the
kmem_cache_* macro, then undefining then inside spl-kmem-cache.c,
instead we make a special tag to indicate we're currently inside
spl-kmem-cache.c, and not defining those in macros in the first place,
so we can use the kernel-supplied kmem_cache_* functions to implement
spl_kmem_cache_*, as we expect.

For all other callers, we create the macros as normal and remove access
to the kernel's own conflicting names.

Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>

Details

Provenance
rob.norris_klarasystems.comAuthored on May 28 2024, 3:56 PM
Tony Hutter <hutter2@llnl.gov>Committed on Jul 16 2024, 12:10 AM
Parents
rGb409892ae502: Linux 6.10: rework queue limits setup
Branches
Unknown
Tags
Unknown