From fe5ce9eb024b46702d2c75df16699b7f35f616ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Sun, 13 Apr 2025 13:04:05 +0200 Subject: [PATCH] linuxkpi: Move `put_page()` closer to `get_page()` This is to prepare a future change to the implementation and make it easier to review. Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49811 --- sys/compat/linuxkpi/common/include/linux/mm.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 17b7a4137b7..194baae1d2a 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -275,6 +275,12 @@ get_page(struct page *page) vm_page_wire(page); } +static inline void +put_page(struct page *page) +{ + vm_page_unwire(page, PQ_ACTIVE); +} + void linux_release_pages(struct page **pages, int nr); #define release_pages(pages, nr) linux_release_pages((pages), (nr)) @@ -334,12 +340,6 @@ pin_user_pages_remote(struct task_struct *task, struct mm_struct *mm, task, mm, start, nr_pages, gup_flags, pages, vmas); } -static inline void -put_page(struct page *page) -{ - vm_page_unwire(page, PQ_ACTIVE); -} - #define unpin_user_page(page) put_page(page) #define unpin_user_pages(pages, npages) release_pages(pages, npages)