diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2026-04-14 13:40:24 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2026-04-18 01:12:12 +0000 |
| commit | 35b90c21f48056e85b70dbbe2209b6c3a4927315 (patch) | |
| tree | e036c63b8e8fa3bd2727edfadc2aadaafda9a02e | |
| parent | 98297ff3cfbb42df86fa7af51a2740d5aa7236eb (diff) | |
LinuxKPI: add default_gfp()
Various new allocation macros can take an optional gfp_t argument.
If the argument is not given we need to set the GFP_KERNEL default.
While this is only internally used and I initialy called it differently,
should this spread elsewhere having the same name as in Linux will be
good.
Sponsored by: The FreeBSD Foundaton
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D56392
| -rw-r--r-- | sys/compat/linuxkpi/common/include/linux/gfp.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/gfp.h b/sys/compat/linuxkpi/common/include/linux/gfp.h index 7a32e7862338..af7cdb422fcb 100644 --- a/sys/compat/linuxkpi/common/include/linux/gfp.h +++ b/sys/compat/linuxkpi/common/include/linux/gfp.h @@ -80,6 +80,9 @@ CTASSERT((__GFP_DMA32 & GFP_NATIVE_MASK) == 0); CTASSERT((__GFP_BITS_MASK & GFP_NATIVE_MASK) == GFP_NATIVE_MASK); +#define __default_gfp(_discard, _arg_or_default, ...) _arg_or_default +#define default_gfp(...) __default_gfp(, ##__VA_ARGS__, GFP_KERNEL) + struct page_frag_cache { void *va; int pagecnt_bias; |
