1 diff -ur lin_tape-3.0.23/upper.c lin_tape-3.0.23.iov/upper.c
2 --- lin_tape-3.0.23/upper.c 2018-04-07 22:18:09.417415364 +0200
3 +++ lin_tape-3.0.23.iov/upper.c 2018-04-07 22:19:26.582769230 +0200
5 if (hdr->iovec_count) {
6 const int size = sizeof(struct sg_iovec) * hdr->iovec_count;
8 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
11 + sg_iov = kmalloc(size, GFP_KERNEL);
17 + ret = import_iovec(hdr->dxfer_direction == SG_DXFER_TO_DEV ? WRITE : READ, hdr->dxferp, hdr->iovec_count, 0, (struct iovec **)&sg_iov, &i);
21 + iov_iter_truncate(&i, hdr->dxfer_len);
22 + iov_data_len = hdr->dxfer_len;
29 iov_data_len = hdr->dxfer_len;
33 pfo_cmd.buffer = sg_iov;
34 pfo_cmd.bufflen = iov_data_len;