summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorTony Hutter <[email protected]>2019-01-10 11:03:40 -0800
committerBrian Behlendorf <[email protected]>2019-01-28 10:11:10 -0800
commit77e50c3070a0009c4ed8b50dbb7cf0df48bdda90 (patch)
tree5dd8d9a703f9ae1392985eb9f363965d27e5c0af /config
parent5cb46f6a664db913f0ef2bf8e929c3f8d8cbfc5b (diff)
Linux 5.0 compat: access_ok() drops 'type' parameter
access_ok no longer needs a 'type' parameter in the 5.0 kernel. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes #8261
Diffstat (limited to 'config')
-rw-r--r--config/kernel-access-ok-type.m421
-rw-r--r--config/kernel.m41
2 files changed, 22 insertions, 0 deletions
diff --git a/config/kernel-access-ok-type.m4 b/config/kernel-access-ok-type.m4
new file mode 100644
index 000000000..3b2878a55
--- /dev/null
+++ b/config/kernel-access-ok-type.m4
@@ -0,0 +1,21 @@
+dnl #
+dnl # Linux 5.0: access_ok() drops 'type' parameter:
+dnl #
+dnl # - access_ok(type, addr, size)
+dnl # + access_ok(addr, size)
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_ACCESS_OK_TYPE], [
+ AC_MSG_CHECKING([whether access_ok() has 'type' parameter])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/uaccess.h>
+ ],[
+ const void __user __attribute__((unused)) *addr = (void *) 0xdeadbeef;
+ unsigned long __attribute__((unused)) size = 1;
+ int error __attribute__((unused)) = access_ok(0, addr, size);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ACCESS_OK_TYPE, 1, [kernel has access_ok with 'type' parameter])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
diff --git a/config/kernel.m4 b/config/kernel.m4
index 098c43700..ea04d85b6 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -4,6 +4,7 @@ dnl #
AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL
ZFS_AC_QAT
+ ZFS_AC_KERNEL_ACCESS_OK_TYPE
ZFS_AC_TEST_MODULE
ZFS_AC_KERNEL_MISC_MINOR
ZFS_AC_KERNEL_OBJTOOL