| 1 |
#include <linux/mm.h> |
| 2 |
|
| 3 |
// |
| 4 |
// The following kernel commit changed the get_user_pages_remote() |
| 5 |
// function signature: |
| 6 |
// |
| 7 |
// commit 9beae1ea89305a9667ceaab6d0bf46a045ad71e7 |
| 8 |
// Author: Lorenzo Stoakes <[email protected]> |
| 9 |
// Date: Thu Oct 13 01:20:17 2016 +0100 |
| 10 |
// |
| 11 |
// mm: replace get_user_pages_remote() write/force parameters with gup_flags |
| 12 |
// |
| 13 |
// This removes the 'write' and 'force' from get_user_pages_remote() and |
| 14 |
// replaces them with 'gup_flags' to make the use of FOLL_FORCE explicit in |
| 15 |
// callers as use of this flag can result in surprising behaviour (and |
| 16 |
// hence bugs) within the mm subsystem. |
| 17 |
// |
| 18 |
// This changed the function signature from: |
| 19 |
// |
| 20 |
// long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, |
| 21 |
// unsigned long start, unsigned long nr_pages, |
| 22 |
// int write, int force, struct page **pages, |
| 23 |
// struct vm_area_struct **vmas); |
| 24 |
// |
| 25 |
// to: |
| 26 |
// |
| 27 |
// long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, |
| 28 |
// unsigned long start, unsigned long nr_pages, |
| 29 |
// unsigned int gup_flags, struct page **pages, |
| 30 |
// struct vm_area_struct **vmas); |
| 31 |
// |
| 32 |
|
| 33 |
long gupr_wrapper(struct task_struct *tsk, struct mm_struct *mm, |
| 34 |
unsigned long start, unsigned long nr_pages, |
| 35 |
unsigned int gup_flags, struct page **pages, |
| 36 |
struct vm_area_struct **vmas); |
| 37 |
|
| 38 |
long gupr_wrapper(struct task_struct *tsk, struct mm_struct *mm, |
| 39 |
unsigned long start, unsigned long nr_pages, |
| 40 |
unsigned int gup_flags, struct page **pages, |
| 41 |
struct vm_area_struct **vmas) |
| 42 |
{ |
| 43 |
return get_user_pages_remote(tsk, mm, start, nr_pages, gup_flags, |
| 44 |
pages, vmas); |
| 45 |
} |