]>
Commit | Line | Data |
---|---|---|
cb2d1901 ED |
1 | dnl # |
2 | dnl # Linux 2.6.38 - 3.x API | |
3 | dnl # | |
4 | AC_DEFUN([ZFS_AC_KERNEL_FILE_FALLOCATE], [ | |
5 | AC_MSG_CHECKING([whether fops->fallocate() exists]) | |
6 | ZFS_LINUX_TRY_COMPILE([ | |
7 | #include <linux/fs.h> | |
c38367c7 RY |
8 | |
9 | long test_fallocate(struct file *file, int mode, | |
10 | loff_t offset, loff_t len) { return 0; } | |
11 | ||
12 | static const struct file_operations | |
13 | fops __attribute__ ((unused)) = { | |
14 | .fallocate = test_fallocate, | |
cb2d1901 | 15 | }; |
c38367c7 | 16 | ],[ |
cb2d1901 ED |
17 | ],[ |
18 | AC_MSG_RESULT(yes) | |
19 | AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists]) | |
20 | ],[ | |
21 | AC_MSG_RESULT(no) | |
22 | ]) | |
23 | ]) | |
24 | ||
25 | dnl # | |
26 | dnl # Linux 2.6.x - 2.6.37 API | |
27 | dnl # | |
28 | AC_DEFUN([ZFS_AC_KERNEL_INODE_FALLOCATE], [ | |
29 | AC_MSG_CHECKING([whether iops->fallocate() exists]) | |
30 | ZFS_LINUX_TRY_COMPILE([ | |
31 | #include <linux/fs.h> | |
cb2d1901 | 32 | |
c38367c7 RY |
33 | long test_fallocate(struct inode *inode, int mode, |
34 | loff_t offset, loff_t len) { return 0; } | |
35 | ||
36 | static const struct inode_operations | |
37 | fops __attribute__ ((unused)) = { | |
38 | .fallocate = test_fallocate, | |
0a6b03d3 | 39 | }; |
c38367c7 | 40 | ],[ |
0a6b03d3 RY |
41 | ],[ |
42 | AC_MSG_RESULT(yes) | |
c38367c7 | 43 | AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists]) |
0a6b03d3 RY |
44 | ],[ |
45 | AC_MSG_RESULT(no) | |
46 | ]) | |
47 | ]) | |
48 | ||
cb2d1901 ED |
49 | dnl # |
50 | dnl # The fallocate callback was moved from the inode_operations | |
51 | dnl # structure to the file_operations structure. | |
52 | dnl # | |
53 | AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [ | |
54 | ZFS_AC_KERNEL_FILE_FALLOCATE | |
55 | ZFS_AC_KERNEL_INODE_FALLOCATE | |
56 | ]) |