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
6 down_read(&mm->mmap_sem);
7 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
8 + ret = get_user_pages((unsigned long)address,
10 ret = get_user_pages(current, mm, (unsigned long)address,
12 page_count, write, force, user_pages, NULL);
13 up_read(&mm->mmap_sem);
16 else if (pinned < page_count)
18 for (i = 0; i < pinned; i++)
19 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
20 + put_page(user_pages[i]);
22 page_cache_release(user_pages[i]);
24 os_free_mem(user_pages);
25 return RM_ERR_INVALID_ADDRESS;
30 set_page_dirty_lock(user_pages[i]);
31 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
32 + put_page(user_pages[i]);
34 page_cache_release(user_pages[i]);
38 os_free_mem(user_pages);