Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Aug 2022 14:04:24 GMT
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d1c3cfd79da1 - main - linuxkpi: Add trylock_page and unlock_page
Message-ID:  <202208081404.278E4Ong088964@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by manu:

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

commit d1c3cfd79da148755ef0fa51f65cd8d0d64b9a88
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-08-02 07:33:47 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-08-08 13:22:35 +0000

    linuxkpi: Add trylock_page and unlock_page
    
    Simple wrapper around vm_page_trylock and vm_page_unlock.
    
    Reviewed by:    hselasky
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
    Differential Revision:  https://reviews.freebsd.org/D36019
---
 sys/compat/linuxkpi/common/include/linux/mm.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h
index 5a16cf0d0a58..a266b5913625 100644
--- a/sys/compat/linuxkpi/common/include/linux/mm.h
+++ b/sys/compat/linuxkpi/common/include/linux/mm.h
@@ -288,6 +288,19 @@ vmalloc_to_page(const void *addr)
 	return (PHYS_TO_VM_PAGE(paddr));
 }
 
+static inline int
+trylock_page(struct page *page)
+{
+	return (vm_page_trylock(page));
+}
+
+static inline void
+unlock_page(struct page *page)
+{
+
+	vm_page_unlock(page);
+}
+
 extern int is_vmalloc_addr(const void *addr);
 void si_meminfo(struct sysinfo *si);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202208081404.278E4Ong088964>