]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-fallocate.m4
removal of LegacyVersion broke ax_python_dev.m4
[mirror_zfs.git] / config / kernel-fallocate.m4
CommitLineData
cb2d1901 1dnl #
066e8252 2dnl # Linux 2.6.38 - 3.x API
608f8749
BB
3dnl # The fallocate callback was moved from the inode_operations
4dnl # structure to the file_operations structure.
cb2d1901 5dnl #
4372e96f
RE
6dnl #
7dnl # Linux 3.15+
8dnl # fallocate learned a new flag, FALLOC_FL_ZERO_RANGE
9dnl #
608f8749 10AC_DEFUN([ZFS_AC_KERNEL_SRC_FALLOCATE], [
608f8749 11 ZFS_LINUX_TEST_SRC([file_fallocate], [
cb2d1901 12 #include <linux/fs.h>
c38367c7
RY
13
14 long test_fallocate(struct file *file, int mode,
15 loff_t offset, loff_t len) { return 0; }
16
17 static const struct file_operations
18 fops __attribute__ ((unused)) = {
19 .fallocate = test_fallocate,
cb2d1901 20 };
608f8749 21 ], [])
4372e96f
RE
22 ZFS_LINUX_TEST_SRC([falloc_fl_zero_range], [
23 #include <linux/falloc.h>
24 ],[
25 int flags __attribute__ ((unused));
26 flags = FALLOC_FL_ZERO_RANGE;
27 ])
608f8749
BB
28])
29
30AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
31 AC_MSG_CHECKING([whether fops->fallocate() exists])
32 ZFS_LINUX_TEST_RESULT([file_fallocate], [
33 AC_MSG_RESULT(yes)
4372e96f
RE
34 AC_MSG_CHECKING([whether FALLOC_FL_ZERO_RANGE exists])
35 ZFS_LINUX_TEST_RESULT([falloc_fl_zero_range], [
36 AC_MSG_RESULT(yes)
37 AC_DEFINE(HAVE_FALLOC_FL_ZERO_RANGE, 1, [FALLOC_FL_ZERO_RANGE is defined])
38 ],[
39 AC_MSG_RESULT(no)
40 ])
0a6b03d3 41 ],[
066e8252 42 ZFS_LINUX_TEST_ERROR([file_fallocate])
0a6b03d3
RY
43 ])
44])