]> git.proxmox.com Git - mirror_spl-debian.git/blame - config/kernel-fallocate.m4
dch: close a bug and refresh timestamp.
[mirror_spl-debian.git] / config / kernel-fallocate.m4
CommitLineData
34ee731f
AX
1dnl #
2dnl # Linux 2.6.38 - 3.x API
3dnl #
4AC_DEFUN([SPL_AC_KERNEL_FILE_FALLOCATE], [
5 AC_MSG_CHECKING([whether fops->fallocate() exists])
6 SPL_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])
20dnl #
21dnl # Linux 2.6.x - 2.6.37 API
22dnl #
23AC_DEFUN([SPL_AC_KERNEL_INODE_FALLOCATE], [
24 AC_MSG_CHECKING([whether iops->fallocate() exists])
25 SPL_LINUX_TRY_COMPILE([
26 #include <linux/fs.h>
27 ],[
28 long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
29 struct inode_operations fops __attribute__ ((unused)) = {
30 .fallocate = fallocate,
31 };
32 ],[
33 AC_MSG_RESULT(yes)
34 AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
35 ],[
36 AC_MSG_RESULT(no)
37 ])
38])
39
40dnl #
41dnl # PaX Linux 2.6.38 - 3.x API
42dnl #
43AC_DEFUN([SPL_AC_PAX_KERNEL_FILE_FALLOCATE], [
44 AC_MSG_CHECKING([whether fops->fallocate() exists])
45 SPL_LINUX_TRY_COMPILE([
46 #include <linux/fs.h>
47 ],[
48 long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
49 struct file_operations_no_const fops __attribute__ ((unused)) = {
50 .fallocate = fallocate,
51 };
52 ],[
53 AC_MSG_RESULT(yes)
54 AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
55 ],[
56 AC_MSG_RESULT(no)
57 ])
58])
59
60dnl #
61dnl # The fallocate callback was moved from the inode_operations
62dnl # structure to the file_operations structure.
63dnl #
64AC_DEFUN([SPL_AC_KERNEL_FALLOCATE], [
65 SPL_AC_KERNEL_FILE_FALLOCATE
66 SPL_AC_KERNEL_INODE_FALLOCATE
67 SPL_AC_PAX_KERNEL_FILE_FALLOCATE
68])