2 dnl # Linux 2.6.38 - 3.x API
4 AC_DEFUN([ZFS_AC_KERNEL_FILE_FALLOCATE], [
5 AC_MSG_CHECKING([whether fops->fallocate() exists])
6 ZFS_LINUX_TRY_COMPILE([
9 long test_fallocate(struct file *file, int mode,
10 loff_t offset, loff_t len) { return 0; }
12 static const struct file_operations
13 fops __attribute__ ((unused)) = {
14 .fallocate = test_fallocate,
19 AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
26 dnl # Linux 2.6.x - 2.6.37 API
28 AC_DEFUN([ZFS_AC_KERNEL_INODE_FALLOCATE], [
29 AC_MSG_CHECKING([whether iops->fallocate() exists])
30 ZFS_LINUX_TRY_COMPILE([
33 long test_fallocate(struct inode *inode, int mode,
34 loff_t offset, loff_t len) { return 0; }
36 static const struct inode_operations
37 fops __attribute__ ((unused)) = {
38 .fallocate = test_fallocate,
43 AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
50 dnl # The fallocate callback was moved from the inode_operations
51 dnl # structure to the file_operations structure.
53 AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
54 ZFS_AC_KERNEL_FILE_FALLOCATE
55 ZFS_AC_KERNEL_INODE_FALLOCATE