---- lin_tape-3.0.8/lin_tape_scsi_tape.c~ 2017-01-21 20:53:26.000000000 +0100
-+++ lin_tape-3.0.8/lin_tape_scsi_tape.c 2017-01-21 20:58:23.919843647 +0100
-@@ -11480,7 +11480,9 @@
+--- lin_tape-3.0.18/lin_tape_scsi_tape.c~ 2017-02-23 19:14:41.000000000 +0100
++++ lin_tape-3.0.18/lin_tape_scsi_tape.c 2017-05-09 21:28:19.916320963 +0200
+@@ -11838,7 +11838,10 @@
- memset(pages, '\0', drv->supported_sg_tablesize * sizeof(struct page*));
+ down_read(¤t->mm->mmap_sem);
--#if LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
-+ mapped_pages = get_user_pages_unlocked((ulong)user_location, number_pages, pages, rw ? FOLL_WRITE : 0);
-+#elif LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
- mapped_pages = get_user_pages_unlocked((ulong)user_location, number_pages, rw, 0, pages);
++ mapped_pages = get_user_pages((ulong)user_location, number_pages,
++ rw ? FOLL_WRITE : 0, pages, NULL);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+ mapped_pages = get_user_pages((ulong)user_location, number_pages,
+ rw, 0, pages, NULL);
#else
+--- lin_tape-3.0.18/stmp.c~ 2017-05-09 21:25:12.000000000 +0200
++++ lin_tape-3.0.18/stmp.c 2017-05-09 21:29:19.121101188 +0200
+@@ -5205,7 +5205,14 @@
+ /* Try to fault in all of the necessary pages */
down_read(¤t->mm->mmap_sem);
---- lin_tape-3.0.8/stmp.c~ 2017-01-21 20:59:35.000000000 +0100
-+++ lin_tape-3.0.8/stmp.c 2017-01-21 21:01:53.144286074 +0100
-@@ -5329,7 +5329,13 @@
-
- if ((pages = kmalloc(max_pages * sizeof(*pages), GFP_KERNEL)) == NULL)
- return -ENOMEM;
--#if LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
+ /* rw==READ means read from drive, write into memory area */
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
-+ res = get_user_pages_unlocked(
++ res = get_user_pages(
+ uaddr,
+ nr_pages,
++ rw == READ ? FOLL_WRITE : 0,
+ pages,
-+ rw == READ ? FOLL_WRITE : 0);
-+#elif LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
- res = get_user_pages_unlocked(
++ NULL);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+ res = get_user_pages(
uaddr,
nr_pages,