Use KERNEL_DS instead of get_ds()

This patch is necessary to make SCST work with Linux kernel v5.1 and
does not change any functionality. See also upstream commit 736706bee329
("get rid of legacy 'get_ds()' function").



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8057 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-03-18 00:24:56 +00:00
parent 0655c3e76a
commit 3b76bc5b1f
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -787,7 +787,7 @@ static int conn_setup_sock(struct iscsi_conn *conn)
conn->sock->sk->sk_user_data = conn;
oldfs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
conn->sock->ops->setsockopt(conn->sock, SOL_TCP, TCP_NODELAY,
(void __force __user *)&opt, sizeof(opt));
set_fs(oldfs);
+1 -1
View File
@@ -2899,7 +2899,7 @@ static inline void set_cork(struct socket *sock, int on)
mm_segment_t oldfs;
oldfs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
sock->ops->setsockopt(sock, SOL_TCP, TCP_CORK,
(void __force __user *)&opt, sizeof(opt));
set_fs(oldfs);
+1 -1
View File
@@ -565,7 +565,7 @@ restart:
#endif
oldfs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
res = sock_recvmsg(conn->sock, msg,
#if SOCK_RECVMSG_HAS_FOUR_ARGS
read_size,
+6 -6
View File
@@ -1720,7 +1720,7 @@ static int vdisk_format_dif(struct scst_cmd *cmd, uint64_t start_lba,
iv[i].iov_base = (uint8_t __force __user *)data_buf;
old_fs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
loff = start_lba << SCST_DIF_TAG_SHIFT;
left = blocks << SCST_DIF_TAG_SHIFT;
@@ -3003,7 +3003,7 @@ static ssize_t fileio_read_sync(struct file *fd, void *buf, size_t len,
ssize_t ret;
old_fs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
ret = scst_read(fd, buf, len, loff);
set_fs(old_fs);
@@ -5394,7 +5394,7 @@ static int vdev_read_dif_tags(struct vdisk_cmd_params *p)
max_iv_count = p->sync.iv_count;
old_fs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
tags_sg = NULL;
loff = (p->loff >> cmd->dev->block_shift) << SCST_DIF_TAG_SHIFT;
@@ -5515,7 +5515,7 @@ static int vdev_write_dif_tags(struct vdisk_cmd_params *p)
max_iv_count = p->sync.iv_count;
old_fs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
tags_sg = NULL;
loff = (p->loff >> cmd->dev->block_shift) << SCST_DIF_TAG_SHIFT;
@@ -5701,7 +5701,7 @@ static enum compl_status_e fileio_exec_write(struct vdisk_cmd_params *p)
}
old_fs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
while (1) {
iv_count = 0;
@@ -6415,7 +6415,7 @@ static enum compl_status_e fileio_exec_read(struct vdisk_cmd_params *p)
}
old_fs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
while (1) {
iv_count = 0;
+1 -1
View File
@@ -5928,7 +5928,7 @@ static void scst_complete_request_sense(struct scst_cmd *req_cmd)
static int scst_cmp_fs_ds(void)
{
mm_segment_t fs = get_fs();
mm_segment_t ds = get_ds();
mm_segment_t ds = KERNEL_DS;
return memcmp(&fs, &ds, sizeof(fs));
}