2 dnl # Linux 2.6.38 - 3.x API
3 dnl # The fallocate callback was moved from the inode_operations
4 dnl # structure to the file_operations structure.
8 dnl # fallocate learned a new flag, FALLOC_FL_ZERO_RANGE
10 AC_DEFUN([ZFS_AC_KERNEL_SRC_FALLOCATE], [
11 ZFS_LINUX_TEST_SRC([file_fallocate], [
14 static long test_fallocate(struct file *file, int mode,
15 loff_t offset, loff_t len) { return 0; }
17 static const struct file_operations
18 fops __attribute__ ((unused)) = {
19 .fallocate = test_fallocate,
22 ZFS_LINUX_TEST_SRC([falloc_fl_zero_range], [
23 #include <linux/falloc.h>
25 int flags __attribute__ ((unused));
26 flags = FALLOC_FL_ZERO_RANGE;
30 AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
31 AC_MSG_CHECKING([whether fops->fallocate() exists])
32 ZFS_LINUX_TEST_RESULT([file_fallocate], [
34 AC_MSG_CHECKING([whether FALLOC_FL_ZERO_RANGE exists])
35 ZFS_LINUX_TEST_RESULT([falloc_fl_zero_range], [
37 AC_DEFINE(HAVE_FALLOC_FL_ZERO_RANGE, 1, [FALLOC_FL_ZERO_RANGE is defined])
42 ZFS_LINUX_TEST_ERROR([file_fallocate])