2 dnl # Linux 2.6.38 - 3.x API
4 AC_DEFUN([SPL_AC_KERNEL_FILE_FALLOCATE], [
5 AC_MSG_CHECKING([whether fops->fallocate() exists])
6 SPL_LINUX_TRY_COMPILE([
9 long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
10 struct file_operations fops __attribute__ ((unused)) = {
11 .fallocate = fallocate,
15 AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
21 dnl # Linux 2.6.x - 2.6.37 API
23 AC_DEFUN([SPL_AC_KERNEL_INODE_FALLOCATE], [
24 AC_MSG_CHECKING([whether iops->fallocate() exists])
25 SPL_LINUX_TRY_COMPILE([
28 long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
29 struct inode_operations fops __attribute__ ((unused)) = {
30 .fallocate = fallocate,
34 AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
41 dnl # PaX Linux 2.6.38 - 3.x API
43 AC_DEFUN([SPL_AC_PAX_KERNEL_FILE_FALLOCATE], [
44 AC_MSG_CHECKING([whether fops->fallocate() exists])
45 SPL_LINUX_TRY_COMPILE([
48 long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
49 struct file_operations_no_const fops __attribute__ ((unused)) = {
50 .fallocate = fallocate,
54 AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
61 dnl # The fallocate callback was moved from the inode_operations
62 dnl # structure to the file_operations structure.
64 AC_DEFUN([SPL_AC_KERNEL_FALLOCATE], [
65 SPL_AC_KERNEL_FILE_FALLOCATE
66 SPL_AC_KERNEL_INODE_FALLOCATE
67 SPL_AC_PAX_KERNEL_FILE_FALLOCATE