]>
Commit | Line | Data |
---|---|---|
34ee731f AX |
1 | dnl # |
2 | dnl # Linux 2.6.38 - 3.x API | |
3 | dnl # | |
4 | AC_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 | ]) | |
20 | dnl # | |
21 | dnl # Linux 2.6.x - 2.6.37 API | |
22 | dnl # | |
23 | AC_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 | ||
40 | dnl # | |
41 | dnl # PaX Linux 2.6.38 - 3.x API | |
42 | dnl # | |
43 | AC_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 | ||
60 | dnl # | |
61 | dnl # The fallocate callback was moved from the inode_operations | |
62 | dnl # structure to the file_operations structure. | |
63 | dnl # | |
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 | |
68 | ]) |