scst, iscsi-scst: Port to Linux kernel v4.20

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7810 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2018-11-10 17:51:41 +00:00
parent e79fcbd8f3
commit 5a1474df43
3 changed files with 18 additions and 4 deletions

View File

@@ -1498,7 +1498,9 @@ static void cmnd_prepare_get_rejected_immed_data(struct iscsi_cmnd *cmnd)
e = min_t(u32, s, PAGE_SIZE);
conn->read_iov[i].iov_len = e;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
iov_iter_kvec(&conn->read_msg.msg_iter, READ, conn->read_iov, i, size);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
iov_iter_kvec(&conn->read_msg.msg_iter, READ | ITER_KVEC,
conn->read_iov, i, size);
#else
@@ -1651,7 +1653,10 @@ static int cmnd_prepare_recv_pdu(struct iscsi_conn *conn,
}
i++;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
iov_iter_kvec(&conn->read_msg.msg_iter, READ, conn->read_iov, i,
read_size);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
iov_iter_kvec(&conn->read_msg.msg_iter, READ | ITER_KVEC,
conn->read_iov, i, read_size);
#else
@@ -1845,7 +1850,10 @@ static int nop_out_start(struct iscsi_cmnd *cmnd)
sBUG_ON(size != 0);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
iov_iter_kvec(&conn->read_msg.msg_iter, READ, conn->read_iov,
i, cmnd->pdu.datasize);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
iov_iter_kvec(&conn->read_msg.msg_iter, READ | ITER_KVEC,
conn->read_iov, i, cmnd->pdu.datasize);
#else

View File

@@ -470,7 +470,9 @@ static inline void iscsi_conn_init_read(struct iscsi_conn *conn,
{
conn->read_iov[0].iov_base = data;
conn->read_iov[0].iov_len = len;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
iov_iter_kvec(&conn->read_msg.msg_iter, READ, conn->read_iov, 1, len);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
iov_iter_kvec(&conn->read_msg.msg_iter, READ | ITER_KVEC,
conn->read_iov, 1, len);
#else

View File

@@ -3299,8 +3299,12 @@ static enum compl_status_e fileio_exec_async(struct vdisk_cmd_params *p)
length = scst_get_buf_next(cmd, &address);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
iov_iter_kvec(&iter, dir, p->async.kvec, kvec - p->async.kvec, total);
#else
iov_iter_kvec(&iter, ITER_KVEC | dir, p->async.kvec,
kvec - p->async.kvec, total);
#endif
p->async.iocb = (struct kiocb) {
.ki_pos = p->loff,
.ki_filp = fd,