[packages/lin_tape] - fix building with linux 4.9 - rel 2

baggins baggins at pld-linux.org
Sat Jan 21 21:02:54 CET 2017


commit 6f6082f9ac320bc0d5ed2b6c65ea67b5d6c41444
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Jan 21 21:02:34 2017 +0100

    - fix building with linux 4.9
    - rel 2

 lin_tape.spec   |  4 +++-
 linux-4.9.patch | 30 ++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)
---
diff --git a/lin_tape.spec b/lin_tape.spec
index 34af321..4a7909a 100644
--- a/lin_tape.spec
+++ b/lin_tape.spec
@@ -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
index 0000000..22da2ce
--- /dev/null
+++ b/linux-4.9.patch
@@ -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,
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lin_tape.git/commitdiff/6f6082f9ac320bc0d5ed2b6c65ea67b5d6c41444



More information about the pld-cvs-commit mailing list