1 --- NVIDIA-Linux-x86_64-304.131-no-compat32/kernel/nv-mlock.c~ 2015-11-09 06:43:39.000000000 +0100
2 +++ NVIDIA-Linux-x86_64-304.131-no-compat32/kernel/nv-mlock.c 2016-06-19 18:34:23.039063568 +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;
29 pci_unmap_page(dev, pte_array[j],
30 PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
31 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
32 + put_page(user_pages[j]);
34 page_cache_release(user_pages[j]);
37 os_free_mem(user_pages);
38 return RM_ERR_OPERATING_SYSTEM;
40 PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
42 set_page_dirty_lock(user_pages[i]);
43 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
44 + put_page(user_pages[i]);
46 page_cache_release(user_pages[i]);
50 os_free_mem(user_pages);