]> git.pld-linux.org Git - packages/lin_tape.git/blobdiff - linux-4.9.patch
- fix building with linux 4.9
[packages/lin_tape.git] / linux-4.9.patch
diff --git a/linux-4.9.patch b/linux-4.9.patch
new file mode 100644 (file)
index 0000000..22da2ce
--- /dev/null
@@ -0,0 +1,30 @@
+--- 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 @@
+       memset(pages, '\0', drv->supported_sg_tablesize * sizeof(struct page*));
+-#if LINUX_VERSION_CODE > KERNEL_VERSION(4,5,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);
+ #else
+       down_read(&current->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)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
++       res = get_user_pages_unlocked(
++              uaddr,
++              nr_pages,
++              pages,
++              rw == READ ? FOLL_WRITE : 0);
++#elif LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
+        res = get_user_pages_unlocked(
+               uaddr,
+               nr_pages,
This page took 0.055629 seconds and 4 git commands to generate.