]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - config/kernel-fallocate.m4
Silence -Winfinite-recursion warning in luaD_throw()
[FreeBSD/FreeBSD.git] / config / kernel-fallocate.m4
1 dnl #
2 dnl # Linux 2.6.38 - 3.x API
3 dnl # The fallocate callback was moved from the inode_operations
4 dnl # structure to the file_operations structure.
5 dnl #
6 dnl #
7 dnl # Linux 3.15+
8 dnl # fallocate learned a new flag, FALLOC_FL_ZERO_RANGE
9 dnl #
10 AC_DEFUN([ZFS_AC_KERNEL_SRC_FALLOCATE], [
11         ZFS_LINUX_TEST_SRC([file_fallocate], [
12                 #include <linux/fs.h>
13
14                 long test_fallocate(struct file *file, int mode,
15                     loff_t offset, loff_t len) { return 0; }
16
17                 static const struct file_operations
18                     fops __attribute__ ((unused)) = {
19                         .fallocate = test_fallocate,
20                 };
21         ], [])
22         ZFS_LINUX_TEST_SRC([falloc_fl_zero_range], [
23                 #include <linux/falloc.h>
24         ],[
25                 int flags __attribute__ ((unused));
26                 flags = FALLOC_FL_ZERO_RANGE;
27         ])
28 ])
29
30 AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
31         AC_MSG_CHECKING([whether fops->fallocate() exists])
32         ZFS_LINUX_TEST_RESULT([file_fallocate], [
33                 AC_MSG_RESULT(yes)
34                 AC_MSG_CHECKING([whether FALLOC_FL_ZERO_RANGE exists])
35                 ZFS_LINUX_TEST_RESULT([falloc_fl_zero_range], [
36                         AC_MSG_RESULT(yes)
37                         AC_DEFINE(HAVE_FALLOC_FL_ZERO_RANGE, 1, [FALLOC_FL_ZERO_RANGE is defined])
38                 ],[
39                         AC_MSG_RESULT(no)
40                 ])
41         ],[
42                 ZFS_LINUX_TEST_ERROR([file_fallocate])
43         ])
44 ])