| 1 |
#include <linux/mm.h> |
| 2 |
|
| 3 |
// |
| 4 |
// The following kernel commit changed the get_user_pages() |
| 5 |
// function signature for linux-5.9: |
| 6 |
// |
| 7 |
// commit 64019a2e467a288a16b65ab55ddcbf58c1b00187 |
| 8 |
// Author: Peter Xu <[email protected]> |
| 9 |
// Date: Tue Aug 11 18:39:01 2020 -0700 |
| 10 |
// |
| 11 |
// mm/gup: remove task_struct pointer for all gup code |
| 12 |
// |
| 13 |
// After the cleanup of page fault accounting, gup does not need to pass |
| 14 |
// task_struct around any more. Remove that parameter in the whole gup |
| 15 |
// stack. |
| 16 |
// |
| 17 |
// This changed the function signature from: |
| 18 |
// |
| 19 |
// long get_user_pages(struct task_struct *tsk, struct mm_struct *mm, |
| 20 |
// unsigned long start, unsigned long nr_pages, |
| 21 |
// unsigned int gup_flags, struct page **pages, |
| 22 |
// struct vm_area_struct **vmas); |
| 23 |
// |
| 24 |
// to |
| 25 |
// |
| 26 |
// long get_user_pages(struct mm_struct *mm, |
| 27 |
// unsigned long start, unsigned long nr_pages, |
| 28 |
// unsigned int gup_flags, struct page **pages, |
| 29 |
// struct vm_area_struct **vmas); |
| 30 |
// |
| 31 |
|
| 32 |
long gupr_wrapper(struct mm_struct *mm, |
| 33 |
unsigned long start, unsigned long nr_pages, |
| 34 |
unsigned int gup_flags, struct page **pages, |
| 35 |
struct vm_area_struct **vmas); |
| 36 |
|
| 37 |
long gupr_wrapper(struct mm_struct *mm, |
| 38 |
unsigned long start, unsigned long nr_pages, |
| 39 |
unsigned int gup_flags, struct page **pages, |
| 40 |
struct vm_area_struct **vmas) |
| 41 |
{ |
| 42 |
return get_user_pages(mm, start, nr_pages, gup_flags, pages, vmas); |
| 43 |
} |