Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102936946
D38078.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D38078.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h
--- a/sys/compat/linuxkpi/common/include/linux/mm.h
+++ b/sys/compat/linuxkpi/common/include/linux/mm.h
@@ -257,25 +257,54 @@
extern long
get_user_pages(unsigned long start, unsigned long nr_pages,
- int gup_flags, struct page **,
+ unsigned int gup_flags, struct page **,
struct vm_area_struct **);
+static inline long
+pin_user_pages(unsigned long start, unsigned long nr_pages,
+ unsigned int gup_flags, struct page **pages,
+ struct vm_area_struct **vmas)
+{
+ return get_user_pages(start, nr_pages, gup_flags, pages, vmas);
+}
+
extern int
__get_user_pages_fast(unsigned long start, int nr_pages, int write,
struct page **);
+static inline int
+pin_user_pages_fast(unsigned long start, int nr_pages,
+ unsigned int gup_flags, struct page **pages)
+{
+ return __get_user_pages_fast(
+ start, nr_pages, !!(gup_flags & FOLL_WRITE), pages);
+}
+
extern long
get_user_pages_remote(struct task_struct *, struct mm_struct *,
unsigned long start, unsigned long nr_pages,
- int gup_flags, struct page **,
+ unsigned int gup_flags, struct page **,
struct vm_area_struct **);
+static inline long
+pin_user_pages_remote(struct task_struct *task, struct mm_struct *mm,
+ unsigned long start, unsigned long nr_pages,
+ unsigned int gup_flags, struct page **pages,
+ struct vm_area_struct **vmas)
+{
+ return get_user_pages_remote(
+ task, mm, start, nr_pages, gup_flags, pages, vmas);
+}
+
static inline void
put_page(struct vm_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)
+
#define copy_highpage(to, from) pmap_copy_page(from, to)
static inline pgprot_t
diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c
--- a/sys/compat/linuxkpi/common/src/linux_page.c
+++ b/sys/compat/linuxkpi/common/src/linux_page.c
@@ -249,7 +249,7 @@
long
get_user_pages_remote(struct task_struct *task, struct mm_struct *mm,
- unsigned long start, unsigned long nr_pages, int gup_flags,
+ unsigned long start, unsigned long nr_pages, unsigned int gup_flags,
struct page **pages, struct vm_area_struct **vmas)
{
vm_map_t map;
@@ -260,8 +260,8 @@
}
long
-get_user_pages(unsigned long start, unsigned long nr_pages, int gup_flags,
- struct page **pages, struct vm_area_struct **vmas)
+get_user_pages(unsigned long start, unsigned long nr_pages,
+ unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas)
{
vm_map_t map;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 11:44 PM (22 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14725480
Default Alt Text
D38078.diff (2 KB)
Attached To
Mode
D38078: linuxkpi: Add `pin_user_pages*()` functions
Attached
Detach File
Event Timeline
Log In to Comment