Add .zfs control directory
[zfs.git] / config / kernel-fallocate.m4
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>
8         ],[
9                 long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
10                 struct file_operations fops __attribute__ ((unused)) = {
11                         .fallocate = fallocate,
12                 };
13         ],[
14                 AC_MSG_RESULT(yes)
15                 AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
16         ],[
17                 AC_MSG_RESULT(no)
18         ])
19 ])
20
21 dnl #
22 dnl # Linux 2.6.x - 2.6.37 API
23 dnl #
24 AC_DEFUN([ZFS_AC_KERNEL_INODE_FALLOCATE], [
25         AC_MSG_CHECKING([whether iops->fallocate() exists])
26         ZFS_LINUX_TRY_COMPILE([
27                 #include <linux/fs.h>
28         ],[
29                 long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
30                 struct inode_operations fops __attribute__ ((unused)) = {
31                         .fallocate = fallocate,
32                 };
33         ],[
34                 AC_MSG_RESULT(yes)
35                 AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
36         ],[
37                 AC_MSG_RESULT(no)
38         ])
39 ])
40
41 dnl #
42 dnl # The fallocate callback was moved from the inode_operations
43 dnl # structure to the file_operations structure.
44 dnl #
45 AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
46         ZFS_AC_KERNEL_FILE_FALLOCATE
47         ZFS_AC_KERNEL_INODE_FALLOCATE
48 ])