Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 2026 21:08:55 +0000
From:      Bjoern A. Zeeb <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d73d7776b508 - stable/15 - LinuxKPI: add default_gfp()
Message-ID:  <69e938e7.275f7.1df4a031@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=d73d7776b508a80b8798db9d8896224410e08a24

commit d73d7776b508a80b8798db9d8896224410e08a24
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-04-14 13:40:24 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-04-22 20:57:08 +0000

    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
    Reviewed by:    dumbbell
    Differential Revision: https://reviews.freebsd.org/D56392
    
    (cherry picked from commit 35b90c21f48056e85b70dbbe2209b6c3a4927315)
---
 sys/compat/linuxkpi/common/include/linux/gfp.h | 3 +++
 1 file changed, 3 insertions(+)

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;


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e938e7.275f7.1df4a031>