1 diff -ur lin_tape-3.0.8.orig/lower.c lin_tape-3.0.8/lower.c
2 --- lin_tape-3.0.8.orig/lower.c 2016-03-15 23:39:12.000000000 +0100
3 +++ lin_tape-3.0.8/lower.c 2016-06-19 13:16:12.828653141 +0200
5 } else if (pfo_cmd->source == PFO_SOURCE_SG ||
6 pfo_cmd->source == PFO_SOURCE_IOCTL) {
7 if (pfo_cmd->iov_count) {
8 +#if LINUX_VERSION_CODE > KERNEL_VERSION(3,19,0)
9 + struct iovec *iov = NULL;
11 + err = import_iovec(write, pfo_cmd->buffer, pfo_cmd->iov_count, 0, &iov, &i);
14 + iov_iter_truncate(&i, pfo_cmd->bufflen);
16 + err = blk_rq_map_user_iov(sdev->request_queue,
23 err = blk_rq_map_user_iov(sdev->request_queue,
32 err = blk_rq_map_user(sdev->request_queue,
34 diff -ur lin_tape-3.0.8.orig/sgmp.c lin_tape-3.0.8/sgmp.c
35 --- lin_tape-3.0.8.orig/sgmp.c 2016-06-19 13:15:52.000000000 +0200
36 +++ lin_tape-3.0.8/sgmp.c 2016-06-19 13:16:12.828653141 +0200
39 #include <linux/smp_lock.h>
41 +#include <linux/uio.h>
44 #include <scsi/scsi_dbg.h>
45 @@ -2029,7 +2029,12 @@
49 +#if LINUX_VERSION_CODE > KERNEL_VERSION(3,19,0)
50 + int size = sizeof(struct iovec) * iov_count;
53 int len, size = sizeof(struct sg_iovec) * iov_count;
56 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)
57 iov = memdup_user(hp->dxferp, size);
58 @@ -2046,6 +2051,13 @@
62 +#if LINUX_VERSION_CODE > KERNEL_VERSION(3,19,0)
63 + iov_iter_init(&i, rw, iov, iov_count,
64 + min_t(size_t, hp->dxfer_len,
65 + iov_length(iov, iov_count)));
67 + res = blk_rq_map_user_iov(q, rq, md, &i, GFP_ATOMIC);
69 len = iov_length(iov, iov_count);
70 if (hp->dxfer_len < len) {
71 iov_count = iov_shorten(iov, iov_count, hp->dxfer_len);
73 res = blk_rq_map_user_iov(q, rq, md, (struct sg_iovec *)iov,
79 res = blk_rq_map_user(q, rq, md, hp->dxferp,