HomeFreeBSD

linux/spl/kmem_cache: undefine `kmem_cache_alloc` before defining it

Description

linux/spl/kmem_cache: undefine kmem_cache_alloc before defining it

When compiling a kernel with bcachefs and zfs,
the two macros will collide, making it impossible
to have both filesystems.

It is sufficient to just undefine the macro before calling it.

On why this should be in ZFS rather than bcachefs, currently,
bcachefs is not a in-tree filesystem, but,
it has a reasonably high chance of getting included soon.

This avoids the breakage in ZFS early,
this patch may be distributed downstream in NixOS
and is already used there.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Lahfa <ryan@lahfa.xyz>
Closes #15144

Details

Provenance
Ryan Lahfa <masterancpp@gmail.com>Authored on Aug 7 2023, 8:55 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Aug 25 2023, 8:33 PM
Parents
rGc418edf1d399: Fix some typos
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG1e488eec606c: linux/spl/kmem_cache: undefine `kmem_cache_alloc` before defining it (authored by Ryan Lahfa <masterancpp@gmail.com>).Aug 25 2023, 8:33 PM