forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernel-rw.m4
69 lines (62 loc) · 1.53 KB
/
kernel-rw.m4
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
60
61
62
63
64
65
66
67
68
69
dnl #
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_SRC_WRITE], [
ZFS_LINUX_TEST_SRC([kernel_write], [
#include <linux/fs.h>
],[
struct file *file = NULL;
const void *buf = NULL;
size_t count = 0;
loff_t *pos = NULL;
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)
])
])
dnl #
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_SRC_READ], [
ZFS_LINUX_TEST_SRC([kernel_read], [
#include <linux/fs.h>
],[
struct file *file = NULL;
void *buf = NULL;
size_t count = 0;
loff_t *pos = NULL;
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)
])
])
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
])