]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-fallocate.m4
kernel_fpu fixes
[mirror_zfs.git] / config / kernel-fallocate.m4
CommitLineData
cb2d1901
ED
1dnl #
2dnl # Linux 2.6.38 - 3.x API
3dnl #
4AC_DEFUN([ZFS_AC_KERNEL_FILE_FALLOCATE], [
5 AC_MSG_CHECKING([whether fops->fallocate() exists])
6 ZFS_LINUX_TRY_COMPILE([
7 #include <linux/fs.h>
c38367c7
RY
8
9 long test_fallocate(struct file *file, int mode,
10 loff_t offset, loff_t len) { return 0; }
11
12 static const struct file_operations
13 fops __attribute__ ((unused)) = {
14 .fallocate = test_fallocate,
cb2d1901 15 };
c38367c7 16 ],[
cb2d1901
ED
17 ],[
18 AC_MSG_RESULT(yes)
19 AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
20 ],[
21 AC_MSG_RESULT(no)
22 ])
23])
24
25dnl #
26dnl # Linux 2.6.x - 2.6.37 API
27dnl #
28AC_DEFUN([ZFS_AC_KERNEL_INODE_FALLOCATE], [
29 AC_MSG_CHECKING([whether iops->fallocate() exists])
30 ZFS_LINUX_TRY_COMPILE([
31 #include <linux/fs.h>
cb2d1901 32
c38367c7
RY
33 long test_fallocate(struct inode *inode, int mode,
34 loff_t offset, loff_t len) { return 0; }
35
36 static const struct inode_operations
37 fops __attribute__ ((unused)) = {
38 .fallocate = test_fallocate,
0a6b03d3 39 };
c38367c7 40 ],[
0a6b03d3
RY
41 ],[
42 AC_MSG_RESULT(yes)
c38367c7 43 AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
0a6b03d3
RY
44 ],[
45 AC_MSG_RESULT(no)
46 ])
47])
48
cb2d1901
ED
49dnl #
50dnl # The fallocate callback was moved from the inode_operations
51dnl # structure to the file_operations structure.
52dnl #
53AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
54 ZFS_AC_KERNEL_FILE_FALLOCATE
55 ZFS_AC_KERNEL_INODE_FALLOCATE
56])