summarylogtreecommitdiffstats
path: root/0001-Linux-5.1-compat-get_ds-removed.patch
blob: 3f0213125d9f8315d15a1ada3cff1d859bb1dc8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From 52314bf4d9651233517d8596305b218d8fe30025 Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Thu, 7 Mar 2019 14:44:23 -0800
Subject: [PATCH] Linux 5.1 compat: get_ds() removed

Commit torvalds/linux@736706bee has removed the get_fs() function
as a bit of cleanup.  It has been defined as KERNEL_DS on all
architectures for all supported kernels.  Replace get_fs() with
KERNEL_DS as was done in the kernel.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8479
(adapted from zfs commit b46fd243d57d0af4b4b568d8c0c4b30b79059ecc)
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 include/linux/file_compat.h | 4 ++--
 module/spl/spl-vnode.c      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h
index 2fd6e5fc8..e8eb9d686 100644
--- a/include/linux/file_compat.h
+++ b/include/linux/file_compat.h
@@ -81,7 +81,7 @@ spl_kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos)
 	ssize_t ret;
 
 	saved_fs = get_fs();
-	set_fs(get_ds());
+	set_fs(KERNEL_DS);
 
 	ret = vfs_write(file, (__force const char __user *)buf, count, pos);
 
@@ -101,7 +101,7 @@ spl_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
 	ssize_t ret;
 
 	saved_fs = get_fs();
-	set_fs(get_ds());
+	set_fs(KERNEL_DS);
 
 	ret = vfs_read(file, (void __user *)buf, count, pos);
 
diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c
index cd0015f6b..0eb642936 100644
--- a/module/spl/spl-vnode.c
+++ b/module/spl/spl-vnode.c
@@ -608,7 +608,7 @@ vn_set_pwd(const char *filename)
 	 * size to ensure strncpy_from_user() does not fail with -EFAULT.
 	 */
 	saved_fs = get_fs();
-	set_fs(get_ds());
+	set_fs(KERNEL_DS);
 
 	rc = user_path_dir(filename, &path);
 	if (rc)
-- 
2.21.0