- fix building with linux 4.9 auto/th/lin_tape-3.0.8-2
authorJan Rękorajski <baggins@pld-linux.org>
Sat, 21 Jan 2017 20:02:34 +0000 (21:02 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Sat, 21 Jan 2017 20:02:34 +0000 (21:02 +0100)
- rel 2

lin_tape.spec
linux-4.9.patch [new file with mode: 0644]

index 34af321b0e5d5836eecfedae435be4ae569146c9..4a7909a6dacf08d7ed407f228dd1e977aa9613a0 100644 (file)
@@ -5,7 +5,7 @@
 # nothing to be placed to debuginfo package
 %define                _enable_debug_packages  0
 
-%define                rel     1
+%define                rel     2
 %define                pname   lin_tape
 Summary:       IBM Tape SCSI Device Driver for Linux
 Name:          %{pname}%{_alt_kernel}
@@ -24,6 +24,7 @@ Patch4:               linux-3.19.patch
 Patch5:                linux-4.0.patch
 Patch6:                linux-4.6.patch
 Patch7:                no-uname.patch
+Patch8:                linux-4.9.patch
 # System Storage, Tape systems, Tape drivers and software, Tape device drivers (Linux)
 URL:           http://www.ibm.com/support/fixcentral/
 BuildRequires: rpmbuild(macros) >= 1.701
@@ -79,6 +80,7 @@ compatible platforms.\
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
 
 install -p %{SOURCE1} .
 
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.296652 seconds and 4 git commands to generate.