git: d5edaf3cf216 - stable/13 - LinuxKPI: add dev_alloc_pages()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Wed, 12 Jun 2024 19:16:41 UTC
The branch stable/13 has been updated by bz:

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

commit d5edaf3cf216c5e682a8664e5abb4fc5a01e3fdf
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-04-02 09:44:29 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-06-12 16:57:13 +0000

    LinuxKPI: add dev_alloc_pages()
    
    Add dev_alloc_pages() though it seems a weird KPI, not passing a dev
    despite its name.  Used by updated wireless driver.
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    emaste
    Differential Revision: https://reviews.freebsd.org/D44588
    
    (cherry picked from commit 738c02ba24c66391870067602f1c9c030d5c5e5d)
---
 sys/compat/linuxkpi/common/include/linux/gfp.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/gfp.h b/sys/compat/linuxkpi/common/include/linux/gfp.h
index c5de09e896de..2fcc0dc05f29 100644
--- a/sys/compat/linuxkpi/common/include/linux/gfp.h
+++ b/sys/compat/linuxkpi/common/include/linux/gfp.h
@@ -138,6 +138,12 @@ __free_page(struct page *page)
 	linux_free_pages(page, 0);
 }
 
+static inline struct page *
+dev_alloc_pages(unsigned int order)
+{
+	return (linux_alloc_pages(GFP_ATOMIC, order));
+}
+
 /*
  * Page management for mapped pages:
  */