]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-inode-getattr.m4
Linux 5.19 compat: bdev_max_secure_erase_sectors()
[mirror_zfs.git] / config / kernel-inode-getattr.m4
CommitLineData
608f8749 1AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
e2a82961
CK
2 dnl #
3 dnl # Linux 5.12 API
4 dnl # The getattr I/O operations handler type was extended to require
5 dnl # a struct user_namespace* as its first arg, to support idmapped
6 dnl # mounts.
7 dnl #
8 ZFS_LINUX_TEST_SRC([inode_operations_getattr_userns], [
9 #include <linux/fs.h>
10
11 int test_getattr(
12 struct user_namespace *userns,
13 const struct path *p, struct kstat *k,
14 u32 request_mask, unsigned int query_flags)
15 { return 0; }
16
17 static const struct inode_operations
18 iops __attribute__ ((unused)) = {
19 .getattr = test_getattr,
20 };
21 ],[])
22
23 dnl #
24 dnl # Linux 4.11 API
25 dnl # See torvalds/linux@a528d35
26 dnl #
608f8749 27 ZFS_LINUX_TEST_SRC([inode_operations_getattr_path], [
a3478c07
OF
28 #include <linux/fs.h>
29
30 int test_getattr(
31 const struct path *p, struct kstat *k,
32 u32 request_mask, unsigned int query_flags)
33 { return 0; }
34
35 static const struct inode_operations
36 iops __attribute__ ((unused)) = {
37 .getattr = test_getattr,
38 };
608f8749 39 ],[])
a3478c07 40
608f8749 41 ZFS_LINUX_TEST_SRC([inode_operations_getattr_vfsmount], [
a3478c07
OF
42 #include <linux/fs.h>
43
44 int test_getattr(
45 struct vfsmount *mnt, struct dentry *d,
46 struct kstat *k)
47 { return 0; }
48
49 static const struct inode_operations
50 iops __attribute__ ((unused)) = {
51 .getattr = test_getattr,
52 };
608f8749
BB
53 ],[])
54])
55
56AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
e2a82961
CK
57 dnl #
58 dnl # Kernel 5.12 test
59 dnl #
60 AC_MSG_CHECKING([whether iops->getattr() takes user_namespace])
61 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_userns], [
a3478c07 62 AC_MSG_RESULT(yes)
e2a82961
CK
63 AC_DEFINE(HAVE_USERNS_IOPS_GETATTR, 1,
64 [iops->getattr() takes struct user_namespace*])
a3478c07
OF
65 ],[
66 AC_MSG_RESULT(no)
a3478c07 67
e2a82961
CK
68 dnl #
69 dnl # Kernel 4.11 test
70 dnl #
71 AC_MSG_CHECKING([whether iops->getattr() takes a path])
72 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_path], [
608f8749 73 AC_MSG_RESULT(yes)
e2a82961
CK
74 AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
75 [iops->getattr() takes a path])
608f8749
BB
76 ],[
77 AC_MSG_RESULT(no)
e2a82961
CK
78
79 dnl #
80 dnl # Kernel < 4.11 test
81 dnl #
82 AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
83 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_vfsmount], [
84 AC_MSG_RESULT(yes)
85 AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
86 [iops->getattr() takes a vfsmount])
87 ],[
88 AC_MSG_RESULT(no)
89 ])
608f8749
BB
90 ])
91 ])
a3478c07 92])