kernel: Update to version 4.4.182
[openwrt/staging/pepe2k.git] / package / kernel / mac80211 / patches / 013-mm-backport-get_user_pages.patch
1 --- a/backport-include/linux/mm.h
2 +++ b/backport-include/linux/mm.h
3 @@ -39,8 +39,20 @@ static inline
4 long backport_get_user_pages_locked(unsigned long start, unsigned long nr_pages,
5 int write, int force, struct page **pages, int *locked)
6 {
7 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,4,168))
8 return get_user_pages_locked(current, current->mm, start, nr_pages,
9 write, force, pages, locked);
10 +#else
11 + int flags = 0;
12 +
13 + if (write)
14 + flags |= FOLL_WRITE;
15 + if (force)
16 + flags |= FOLL_FORCE;
17 +
18 + return get_user_pages_locked(current, current->mm, start, nr_pages,
19 + flags, pages, locked);
20 +#endif
21 }
22 #define get_user_pages_locked LINUX_BACKPORT(get_user_pages_locked)
23
24 @@ -48,8 +60,20 @@ static inline
25 long backport_get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
26 int write, int force, struct page **pages)
27 {
28 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,4,168))
29 return get_user_pages_unlocked(current, current->mm, start, nr_pages,
30 write, force, pages);
31 +#else
32 + int flags = 0;
33 +
34 + if (write)
35 + flags |= FOLL_WRITE;
36 + if (force)
37 + flags |= FOLL_FORCE;
38 +
39 + return get_user_pages_unlocked(current, current->mm, start, nr_pages,
40 + pages, flags);
41 +#endif
42 }
43 #define get_user_pages_unlocked LINUX_BACKPORT(get_user_pages_unlocked)
44 #endif
45 @@ -60,8 +84,20 @@ long backport_get_user_pages(unsigned lo
46 int write, int force, struct page **pages,
47 struct vm_area_struct **vmas)
48 {
49 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,4,168))
50 return get_user_pages(current, current->mm, start, nr_pages,
51 write, force, pages, vmas);
52 +#else
53 + int flags = 0;
54 +
55 + if (write)
56 + flags |= FOLL_WRITE;
57 + if (force)
58 + flags |= FOLL_FORCE;
59 +
60 + return get_user_pages(current, current->mm, start, nr_pages,
61 + flags, pages, vmas);
62 +#endif
63 }
64 #define get_user_pages LINUX_BACKPORT(get_user_pages)
65 #endif