]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - zfs/config/kernel-fallocate.m4
arm64: topology: Avoid checking numa mask for scheduler MC selection
[mirror_ubuntu-bionic-kernel.git] / zfs / config / kernel-fallocate.m4
CommitLineData
70e083d2
TG
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>
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,
15 };
16 ],[
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>
32
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,
39 };
40 ],[
41 ],[
42 AC_MSG_RESULT(yes)
43 AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
44 ],[
45 AC_MSG_RESULT(no)
46 ])
47])
48
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])