File: autoconf-get_user_pages-flags.c

package info (click to toggle)
systemtap 5.1-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 47,964 kB
  • sloc: cpp: 80,838; ansic: 54,757; xml: 49,725; exp: 43,665; sh: 11,527; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (46 lines) | stat: -rw-r--r-- 1,748 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <linux/mm.h>

//
// The following kernel commit changed the get_user_pages() function signature
// on linux-4.4.y:
//
// commit 8e50b8b07f462ab4b91bc1491b1c91bd75e4ad40
// Author: Lorenzo Stoakes <lstoakes@gmail.com>
// Date:   Thu Oct 13 01:20:16 2016 +0100
//
//     mm: replace get_user_pages() write/force parameters with gup_flags
//
//     commit 768ae309a96103ed02eb1e111e838c87854d8b51 upstream.
//
//     This removes the 'write' and 'force' from get_user_pages() and replaces
//     them with 'gup_flags' to make the use of FOLL_FORCE explicit in callers
//     as use of this flag can result in surprising behaviour (and hence bugs)
//     within the mm subsystem.
//
// This changed the function signature from:
//
// long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
//                     unsigned long start, unsigned long nr_pages,
//                     int write, int force, struct page **pages,
//                     struct vm_area_struct **vmas);
//
// to:
//
// long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
//                     unsigned long start, unsigned long nr_pages,
//                     unsigned int gup_flags, struct page **pages,
//                     struct vm_area_struct **vmas);
//

long gupr_wrapper(struct task_struct *tsk, struct mm_struct *mm,
		  unsigned long start, unsigned long nr_pages,
		  unsigned int gup_flags, struct page **pages,
		  struct vm_area_struct **vmas);

long gupr_wrapper(struct task_struct *tsk, 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(tsk, mm, start, nr_pages, gup_flags, pages, vmas);
}