]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia-legacy-340xx.git/blob - linux-4.6.patch
- fixed building with linux 4.6
[packages/xorg-driver-video-nvidia-legacy-340xx.git] / linux-4.6.patch
1 --- NVIDIA-Linux-x86_64-340.96-no-compat32/kernel/os-mlock.c~   2015-11-09 06:44:53.000000000 +0100
2 +++ NVIDIA-Linux-x86_64-340.96-no-compat32/kernel/os-mlock.c    2016-06-19 18:41:01.530699309 +0200
3 @@ -45,7 +45,11 @@
4      }
5  
6      down_read(&mm->mmap_sem);
7 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
8 +    ret = get_user_pages((unsigned long)address,
9 +#else
10      ret = get_user_pages(current, mm, (unsigned long)address,
11 +#endif
12              page_count, write, force, user_pages, NULL);
13      up_read(&mm->mmap_sem);
14      pinned = ret;
15 @@ -58,7 +62,11 @@
16      else if (pinned < page_count)
17      {
18          for (i = 0; i < pinned; i++)
19 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
20 +            put_page(user_pages[i]);
21 +#else
22              page_cache_release(user_pages[i]);
23 +#endif
24          os_free_mem(user_pages);
25          return RM_ERR_INVALID_ADDRESS;
26      }
27 @@ -85,7 +93,11 @@
28      {
29          if (write)
30              set_page_dirty_lock(user_pages[i]);
31 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
32 +        put_page(user_pages[i]);
33 +#else
34          page_cache_release(user_pages[i]);
35 +#endif
36      }
37  
38      os_free_mem(user_pages);
This page took 0.045067 seconds and 3 git commands to generate.