git: d1c3cfd79da1 - main - linuxkpi: Add trylock_page and unlock_page
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 08 Aug 2022 14:04:24 UTC
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);