summaryrefslogtreecommitdiffstats
path: root/config/kernel-rw.m4
diff options
context:
space:
mode:
Diffstat (limited to 'config/kernel-rw.m4')
-rw-r--r--config/kernel-rw.m440
1 files changed, 26 insertions, 14 deletions
diff --git a/config/kernel-rw.m4 b/config/kernel-rw.m4
index 1c8a265e0..85b47d5c6 100644
--- a/config/kernel-rw.m4
+++ b/config/kernel-rw.m4
@@ -3,11 +3,8 @@ dnl # 4.14 API change
dnl # kernel_write() which was introduced in 3.9 was updated to take
dnl # the offset as a pointer which is needed by vn_rdwr().
dnl #
-AC_DEFUN([ZFS_AC_KERNEL_WRITE], [
- AC_MSG_CHECKING([whether kernel_write() takes loff_t pointer])
- tmp_flags="$EXTRA_KCFLAGS"
- EXTRA_KCFLAGS="-Werror"
- ZFS_LINUX_TRY_COMPILE([
+AC_DEFUN([ZFS_AC_KERNEL_SRC_WRITE], [
+ ZFS_LINUX_TEST_SRC([kernel_write], [
#include <linux/fs.h>
],[
struct file *file = NULL;
@@ -17,14 +14,18 @@ AC_DEFUN([ZFS_AC_KERNEL_WRITE], [
ssize_t ret;
ret = kernel_write(file, buf, count, pos);
- ],[
+ ])
+])
+
+AC_DEFUN([ZFS_AC_KERNEL_WRITE], [
+ AC_MSG_CHECKING([whether kernel_write() takes loff_t pointer])
+ ZFS_LINUX_TEST_RESULT([kernel_write], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_KERNEL_WRITE_PPOS, 1,
[kernel_write() take loff_t pointer])
],[
AC_MSG_RESULT(no)
])
- EXTRA_KCFLAGS="$tmp_flags"
])
dnl #
@@ -32,11 +33,8 @@ dnl # 4.14 API change
dnl # kernel_read() which has existed for forever was updated to take
dnl # the offset as a pointer which is needed by vn_rdwr().
dnl #
-AC_DEFUN([ZFS_AC_KERNEL_READ], [
- AC_MSG_CHECKING([whether kernel_read() takes loff_t pointer])
- tmp_flags="$EXTRA_KCFLAGS"
- EXTRA_KCFLAGS="-Werror"
- ZFS_LINUX_TRY_COMPILE([
+AC_DEFUN([ZFS_AC_KERNEL_SRC_READ], [
+ ZFS_LINUX_TEST_SRC([kernel_read], [
#include <linux/fs.h>
],[
struct file *file = NULL;
@@ -46,12 +44,26 @@ AC_DEFUN([ZFS_AC_KERNEL_READ], [
ssize_t ret;
ret = kernel_read(file, buf, count, pos);
- ],[
+ ])
+])
+
+AC_DEFUN([ZFS_AC_KERNEL_READ], [
+ AC_MSG_CHECKING([whether kernel_read() takes loff_t pointer])
+ ZFS_LINUX_TEST_RESULT([kernel_read], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_KERNEL_READ_PPOS, 1,
[kernel_read() take loff_t pointer])
],[
AC_MSG_RESULT(no)
])
- EXTRA_KCFLAGS="$tmp_flags"
+])
+
+AC_DEFUN([ZFS_AC_KERNEL_SRC_RW], [
+ ZFS_AC_KERNEL_SRC_WRITE
+ ZFS_AC_KERNEL_SRC_READ
+])
+
+AC_DEFUN([ZFS_AC_KERNEL_RW], [
+ ZFS_AC_KERNEL_WRITE
+ ZFS_AC_KERNEL_READ
])