CI: Move perl script to dist_noinst_DATA
[zfs.git] / config / kernel-rw.m4
blob85b47d5c6fc228bfdce5b6f14d21a739a9e013d1
1 dnl #
2 dnl # 4.14 API change
3 dnl # kernel_write() which was introduced in 3.9 was updated to take
4 dnl # the offset as a pointer which is needed by vn_rdwr().
5 dnl #
6 AC_DEFUN([ZFS_AC_KERNEL_SRC_WRITE], [
7         ZFS_LINUX_TEST_SRC([kernel_write], [
8                 #include <linux/fs.h>
9         ],[
10                 struct file *file = NULL;
11                 const void *buf = NULL;
12                 size_t count = 0;
13                 loff_t *pos = NULL;
14                 ssize_t ret;
16                 ret = kernel_write(file, buf, count, pos);
17         ])
20 AC_DEFUN([ZFS_AC_KERNEL_WRITE], [
21         AC_MSG_CHECKING([whether kernel_write() takes loff_t pointer])
22         ZFS_LINUX_TEST_RESULT([kernel_write], [
23                 AC_MSG_RESULT(yes)
24                 AC_DEFINE(HAVE_KERNEL_WRITE_PPOS, 1,
25                     [kernel_write() take loff_t pointer])
26         ],[
27                 AC_MSG_RESULT(no)
28         ])
31 dnl #
32 dnl # 4.14 API change
33 dnl # kernel_read() which has existed for forever was updated to take
34 dnl # the offset as a pointer which is needed by vn_rdwr().
35 dnl #
36 AC_DEFUN([ZFS_AC_KERNEL_SRC_READ], [
37         ZFS_LINUX_TEST_SRC([kernel_read], [
38                 #include <linux/fs.h>
39         ],[
40                 struct file *file = NULL;
41                 void *buf = NULL;
42                 size_t count = 0;
43                 loff_t *pos = NULL;
44                 ssize_t ret;
46                 ret = kernel_read(file, buf, count, pos);
47         ])
50 AC_DEFUN([ZFS_AC_KERNEL_READ], [
51         AC_MSG_CHECKING([whether kernel_read() takes loff_t pointer])
52         ZFS_LINUX_TEST_RESULT([kernel_read], [
53                 AC_MSG_RESULT(yes)
54                 AC_DEFINE(HAVE_KERNEL_READ_PPOS, 1,
55                     [kernel_read() take loff_t pointer])
56         ],[
57                 AC_MSG_RESULT(no)
58         ])
61 AC_DEFUN([ZFS_AC_KERNEL_SRC_RW], [
62         ZFS_AC_KERNEL_SRC_WRITE
63         ZFS_AC_KERNEL_SRC_READ
66 AC_DEFUN([ZFS_AC_KERNEL_RW], [
67         ZFS_AC_KERNEL_WRITE
68         ZFS_AC_KERNEL_READ