[packages/lin_tape] - up to 3.0.33
baggins
baggins at pld-linux.org
Sat Oct 27 14:13:51 CEST 2018
commit 651070905af50611d1e48eaffb90210be196fcd4
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sat Oct 27 14:13:37 2018 +0200
- up to 3.0.33
clean-ifdefs.patch | 123 ++++++-----------------------------------------------
lin_tape.spec | 10 ++---
linux-4.10.patch | 81 -----------------------------------
linux-4.11.patch | 6 +--
linux-4.12.patch | 4 +-
linux-4.9.patch | 42 +++++++++---------
6 files changed, 43 insertions(+), 223 deletions(-)
---
diff --git a/lin_tape.spec b/lin_tape.spec
index 2c13a8b..00a9b46 100644
--- a/lin_tape.spec
+++ b/lin_tape.spec
@@ -5,27 +5,27 @@
# nothing to be placed to debuginfo package
%define _enable_debug_packages 0
-%define rel 2
+%define rel 1
%define pname lin_tape
Summary: IBM Tape SCSI Device Driver for Linux
Name: %{pname}%{_alt_kernel}
-Version: 3.0.23
+Version: 3.0.33
Release: %{rel}%{?_pld_builder:@%{_kernel_ver_str}}
License: GPL v2/LGPL
Group: Base/Kernel
Source0: %{pname}-%{version}.tgz
-# Source0-md5: 38edd3855f4205250cb725df6a8ef2a3
+# Source0-md5: c22358f485f12baa7254aa25abe20a43
Source1: %{pname}.fixlist
Patch0: use-module-dir.patch
Patch1: clean-ifdefs.patch
Patch2: linux-4.9.patch
-Patch3: linux-4.10.patch
Patch4: linux-4.11.patch
Patch5: linux-4.12.patch
Patch6: linux-4.13.patch
Patch7: kernel-4.14.patch
Patch8: kernel-4.15.patch
Patch9: kernel-4.17.patch
+Patch10: kernel-4.19.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
@@ -76,13 +76,13 @@ compatible platforms.\
%patch0 -p1
%patch1 -p1
%patch2 -p1
-%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
+%patch10 -p1
install -p %{SOURCE1} .
diff --git a/clean-ifdefs.patch b/clean-ifdefs.patch
index 12db4e9..26763df 100644
--- a/clean-ifdefs.patch
+++ b/clean-ifdefs.patch
@@ -1,7 +1,7 @@
diff -ur lin_tape-3.0.18/Makefile lin_tape-3.0.18-ifdefs/Makefile
--- lin_tape-3.0.18/Makefile 2017-05-09 21:11:32.977092391 +0200
+++ lin_tape-3.0.18-ifdefs/Makefile 2017-05-09 21:05:59.610307494 +0200
-@@ -20,15 +20,6 @@
+@@ -20,27 +20,6 @@
lin_tape-objs := join.o lin_tape_scsi_config.o lin_tape_scsi_tape.o lin_tape_scsi_trace.o \
lin_tape_ioctl_tape.o lin_tape_ioctl_changer.o lin_tape_extra_ioctl.o
@@ -11,7 +11,19 @@ diff -ur lin_tape-3.0.18/Makefile lin_tape-3.0.18-ifdefs/Makefile
-KERNELVER = $(shell uname -r 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/")
-EXTRA_CFLAGS += -DKERNELVERSION_${KERNELVER}
-else
+-UBUNTURELEASE := $(shell [ -f "/etc/os-release" ] && grep -qi Ubuntu /etc/os-release && echo 1 || echo 0)
+-ifeq ($(UBUNTURELEASE), 1)
+-EXTRA_CFLAGS += -DUBUNTUVERSION
+-else
-EXTRA_CFLAGS += -DSLESVERSION
+-KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+-KERNELVER = $(shell uname -r 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/")
+-EXTRA_CFLAGS += -DSLESKERNEL_${KERNELVER}
+-SLESSP2 := $(shell grep -qi SP2 /etc/*release && echo 1 || echo 0)
+-ifeq ($(SLESSP2), 1)
+-EXTRA_CFLAGS += -DSLESSP2
+-endif
+-endif
-endif
-
ifeq ($(SFMP), 1)
@@ -162,112 +174,3 @@ diff -ur lin_tape-3.0.18/pfo.h lin_tape-3.0.18-ifdefs/pfo.h
/* Misc defines needed so source is same for all versions of Linux */
#ifndef SDEV_TRANSPORT_OFFLINE
-diff -ur lin_tape-3.0.18/sgmp.c lin_tape-3.0.18-ifdefs/sgmp.c
---- lin_tape-3.0.18/sgmp.c 2017-02-23 19:14:41.000000000 +0100
-+++ lin_tape-3.0.18-ifdefs/sgmp.c 2017-05-09 21:10:20.295643954 +0200
-@@ -262,27 +262,12 @@
- {
- struct sg_fd *sfp = (struct sg_fd *)filp->private_data;
-
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && (!defined(SLESVERSION))
-- /* RHEL 7.0 and beyond */
- struct request_queue *q = sfp->parentdp->device->request_queue;
--#else
--#ifdef AFTER_RH_63
-- /* RHEL 6.4+ */
-- struct request_queue *q = sfp->parentdp->device->request_queue;
--#endif
--#endif
-
- if (sfp->parentdp->device->type == TYPE_SCANNER)
- return 0;
-
--#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) || defined(SLESVERSION)
- return blk_verify_command(cmd, filp->f_mode & FMODE_WRITE);
--#else
-- /* RHEL 6.4 and beyond */
-- return blk_verify_command(q, cmd, filp->f_mode & FMODE_WRITE);
--#endif
--//6.3 blk_verify_command(cmd, filp->f_mode & FMODE_WRITE);
--
- }
-
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)
-@@ -419,7 +404,7 @@
- #endif
- sdp->sgdebug = 0;
- q = sdp->device->request_queue;
--#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32) && (defined(SLESVERSION))
-+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32)
- sdp->sg_tablesize = min(queue_max_hw_segments(q),
- queue_max_phys_segments(q));
- #else
-@@ -1546,7 +1531,7 @@
- if ((sdp->sgdebug > 0) &&
- ((CHECK_CONDITION == srp->header.masked_status) ||
- (COMMAND_TERMINATED == srp->header.masked_status)))
--#if defined(AFTER_RH_71) || LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
- __scsi_print_sense(sdp->device, "sg_cmd_done", sense, SCSI_SENSE_BUFFERSIZE);
-
- #else
-@@ -1677,7 +1662,7 @@
- INIT_LIST_HEAD(&sdp->sfds);
- init_waitqueue_head(&sdp->o_excl_wait);
-
--#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32) && (defined(SLESVERSION))
-+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32)
- sdp->sg_tablesize = min(queue_max_hw_segments(q),
- queue_max_phys_segments(q));
- #else
-@@ -3069,7 +3054,7 @@
- scsidp->id, scsidp->lun, (int) scsidp->type,
- 1,
- (int) scsidp->queue_depth,
--#ifdef AFTER_RH_71
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
- (int) atomic_read(&scsidp->device_busy),
- #else
- (int) scsidp->device_busy,
-diff -ur lin_tape-3.0.18/stmp.c lin_tape-3.0.18-ifdefs/stmp.c
---- lin_tape-3.0.18/stmp.c 2017-02-23 19:14:41.000000000 +0100
-+++ lin_tape-3.0.18-ifdefs/stmp.c 2017-05-09 21:11:01.113125428 +0200
-@@ -454,7 +454,7 @@
- SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2],
- SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]);
- if (cmdstatp->have_sense)
--#if defined(AFTER_RH_70) || LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
- __scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
-
- #else
-@@ -475,7 +475,7 @@
- SRpnt->cmd[0] != MODE_SENSE &&
- SRpnt->cmd[0] != TEST_UNIT_READY) {
-
--#if defined(AFTER_RH_71) || LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
- __scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
-
- #else
-diff -ur lin_tape-3.0.18/upper.c lin_tape-3.0.18-ifdefs/upper.c
---- lin_tape-3.0.18/upper.c 2017-02-23 19:14:41.000000000 +0100
-+++ lin_tape-3.0.18-ifdefs/upper.c 2017-05-09 21:09:37.868126006 +0200
-@@ -267,7 +267,7 @@
- if (copy_from_user(pfo_cmd->scsi_cmd, hdr->cmdp, hdr->cmd_len))
- return -EFAULT;
-
--#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) || defined(SLESVERSION)
-+#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0)
- if (blk_verify_command(pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
- #else
- /* RHEL 6.4 and beyond */
-@@ -608,7 +608,7 @@
- if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
- goto error;
-
--#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) || defined(SLESVERSION)
-+#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0)
- err = blk_verify_command(scsi_cmd, mode & FMODE_WRITE);
- #else
- /* RHEL 6.4 and beyond */
diff --git a/linux-4.10.patch b/linux-4.10.patch
deleted file mode 100644
index a6f123e..0000000
--- a/linux-4.10.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-diff -ur lin_tape-3.0.23/lin_tape_ioctl_tape.c lin_tape-3.0.23-4.10/lin_tape_ioctl_tape.c
---- lin_tape-3.0.23/lin_tape_ioctl_tape.c 2018-04-08 00:40:34.811170201 +0200
-+++ lin_tape-3.0.23-4.10/lin_tape_ioctl_tape.c 2018-04-08 00:39:08.512197099 +0200
-@@ -6471,7 +6471,7 @@
-
- tmp_rq = (void*)sdev->request_queue;
- req->cmd_type = REQ_TYPE_BLOCK_PC;
--#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
- req->cmd_flags |= REQ_QUIET;
- #else
- req->cmd_flags |= RQF_QUIET;
-diff -ur lin_tape-3.0.23/stmp.c lin_tape-3.0.23-4.10/stmp.c
---- lin_tape-3.0.23/stmp.c 2018-04-08 00:40:34.814503623 +0200
-+++ lin_tape-3.0.23-4.10/stmp.c 2018-04-08 00:39:45.023173000 +0200
-@@ -688,7 +688,7 @@
- #else
- req->cmd_type = REQ_TYPE_BLOCK_PC;
- #endif
--#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
- req->cmd_flags |= REQ_QUIET;
- #else
- req->cmd_flags |= RQF_QUIET;
-diff -ur lin_tape-3.0.23/upper.c lin_tape-3.0.23-4.10/upper.c
---- lin_tape-3.0.23/upper.c 2018-04-08 00:40:34.814503623 +0200
-+++ lin_tape-3.0.23-4.10/upper.c 2018-04-08 00:40:20.187446091 +0200
-@@ -89,7 +89,7 @@
- pfo_cmd.timeout = timeout;
- pfo_cmd.retries = retries;
- pfo_cmd.iov_count = 0;
--#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
- pfo_cmd.flags = flags | REQ_QUIET;
- #else
- pfo_cmd.flags = flags | RQF_QUIET;
-@@ -352,7 +352,7 @@
- pfo_cmd.cmd_len = hdr->cmd_len;
- pfo_cmd.buffer = NULL;
- pfo_cmd.bufflen = 0;
--#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
- pfo_cmd.flags = REQ_QUIET;
- #else
- pfo_cmd.flags = RQF_QUIET;
-@@ -488,7 +488,7 @@
- pfo_cmd.cmd_len = hdr->cmd_len;
- pfo_cmd.buffer = NULL;
- pfo_cmd.bufflen = 0;
--#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
- pfo_cmd.flags = REQ_QUIET;
- #else
- pfo_cmd.flags = RQF_QUIET;
-@@ -691,7 +691,7 @@
- pfo_cmd.timeout = timeout;
- pfo_cmd.retries = retries;
- pfo_cmd.iov_count = 0;
--#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
- pfo_cmd.flags = REQ_QUIET;
- #else
- pfo_cmd.flags = RQF_QUIET;
-@@ -952,7 +952,7 @@
- pfo_cmd.buffer = buffer;
- pfo_cmd.bufflen = bufflen;
- pfo_cmd.retries = retries;
--#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
- pfo_cmd.flags = REQ_QUIET;
- #else
- pfo_cmd.flags = RQF_QUIET;
-@@ -995,7 +995,7 @@
- pfo_cmd.buffer = buffer;
- pfo_cmd.bufflen = bufflen;
- pfo_cmd.retries = retries;
--#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
- pfo_cmd.flags = REQ_QUIET;
- #else
- pfo_cmd.flags = RQF_QUIET;
diff --git a/linux-4.11.patch b/linux-4.11.patch
index d3639d5..71fb6d0 100644
--- a/linux-4.11.patch
+++ b/linux-4.11.patch
@@ -36,10 +36,10 @@ diff -ur lin_tape-3.0.18/lin_tape_ioctl_tape.c lin_tape-3.0.18-4.11/lin_tape_ioc
+#else
req->cmd_type = REQ_TYPE_BLOCK_PC;
+#endif
- #if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
+ #ifdef REQ_QUIET
req->cmd_flags |= REQ_QUIET;
#else
-@@ -6536,17 +6540,29 @@
+@@ -6536,15 +6540,27 @@
bio = req->bio;
} /* if */
@@ -58,9 +58,7 @@ diff -ur lin_tape-3.0.18/lin_tape_ioctl_tape.c lin_tape-3.0.18-4.11/lin_tape_ioc
+#endif
req->timeout = timeout;
req->retries = 0;
-
blk_execute_rq(req->q, NULL, req, 1);
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
+ *resid = scsi_req(req)->resid_len;
+#else
diff --git a/linux-4.12.patch b/linux-4.12.patch
index 7699c7b..14ae055 100644
--- a/linux-4.12.patch
+++ b/linux-4.12.patch
@@ -9,9 +9,9 @@
+#else
req->retries = 0;
+#endif
-
blk_execute_rq(req->q, NULL, req, 1);
-
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
+ *resid = scsi_req(req)->resid_len;
@@ -6563,7 +6567,11 @@
#else
*resid = req->resid_len;
diff --git a/linux-4.9.patch b/linux-4.9.patch
index d35ff3b..c713a0f 100644
--- a/linux-4.9.patch
+++ b/linux-4.9.patch
@@ -1,12 +1,15 @@
--- 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,10 +11838,9 @@
+@@ -11838,13 +11838,9 @@
down_read(¤t->mm->mmap_sem);
-
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,73)
-- mapped_pages = get_user_pages_unlocked((unsigned long)user_location, number_pages,
-- pages, rw);
+ #if !defined (UBUNTUVERSION)
+-#if LINUX_VERSION_CODE == KERNEL_VERSION(4,4,73) \
+- || (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,92) && LINUX_VERSION_CODE < KERNEL_VERSION(4,4,103)) \
+- || defined(SLESKERNEL_4_4_103_6) \
+- || (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,114) && LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) && !defined(SLESSP2))
+- mapped_pages = get_user_pages((unsigned long)user_location, number_pages,
+- rw, pages, NULL);
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
+ mapped_pages = get_user_pages((ulong)user_location, number_pages,
@@ -14,24 +17,21 @@
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
mapped_pages = get_user_pages((ulong)user_location, number_pages,
rw, 0, pages, NULL);
---- 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,11 +5205,13 @@
- if ((pages = kmalloc(max_pages * sizeof(*pages), GFP_KERNEL)) == NULL)
- return -ENOMEM;
+--- lin_tape-3.0.33/stmp.c~ 2018-06-01 20:01:49.000000000 +0200
++++ lin_tape-3.0.33/stmp.c 2018-10-27 11:39:03.873330720 +0200
+@@ -5061,12 +5061,13 @@
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,73)
-- res = get_user_pages_unlocked(uaddr, nr_pages,
-- pages,
-- rw == READ ? FOLL_WRITE : 0); /* don't force */
--
+ /* Try to fault in all of the necessary pages */
+ /* rw==READ means read from drive, write into memory area */
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,114) && LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) && !defined(SLESSP2))
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
-+ res = get_user_pages_unlocked(
-+ uaddr,
-+ nr_pages,
+ res = get_user_pages_unlocked(
+ uaddr,
+ nr_pages,
+ rw == READ ? FOLL_WRITE : 0,
-+ pages,
+ pages,
+- rw == READ ? FOLL_WRITE : 0); /* don't force */
+ NULL);
+
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
- /* Try to fault in all of the necessary pages */
- /* rw==READ means read from drive, write into memory area */
+ res = get_user_pages_unlocked(
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/lin_tape.git/commitdiff/651070905af50611d1e48eaffb90210be196fcd4
More information about the pld-cvs-commit
mailing list