1 AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
4 dnl # The first arg of getattr I/O operations handler type
5 dnl # is changed to struct mnt_idmap*
7 ZFS_LINUX_TEST_SRC([inode_operations_getattr_mnt_idmap], [
11 struct mnt_idmap *idmap,
12 const struct path *p, struct kstat *k,
13 u32 request_mask, unsigned int query_flags)
16 static const struct inode_operations
17 iops __attribute__ ((unused)) = {
18 .getattr = test_getattr,
24 dnl # The getattr I/O operations handler type was extended to require
25 dnl # a struct user_namespace* as its first arg, to support idmapped
28 ZFS_LINUX_TEST_SRC([inode_operations_getattr_userns], [
32 struct user_namespace *userns,
33 const struct path *p, struct kstat *k,
34 u32 request_mask, unsigned int query_flags)
37 static const struct inode_operations
38 iops __attribute__ ((unused)) = {
39 .getattr = test_getattr,
45 dnl # See torvalds/linux@a528d35
47 ZFS_LINUX_TEST_SRC([inode_operations_getattr_path], [
51 const struct path *p, struct kstat *k,
52 u32 request_mask, unsigned int query_flags)
55 static const struct inode_operations
56 iops __attribute__ ((unused)) = {
57 .getattr = test_getattr,
61 ZFS_LINUX_TEST_SRC([inode_operations_getattr_vfsmount], [
65 struct vfsmount *mnt, struct dentry *d,
69 static const struct inode_operations
70 iops __attribute__ ((unused)) = {
71 .getattr = test_getattr,
76 AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
80 AC_MSG_CHECKING([whether iops->getattr() takes mnt_idmap])
81 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_mnt_idmap], [
83 AC_DEFINE(HAVE_IDMAP_IOPS_GETATTR, 1,
84 [iops->getattr() takes struct mnt_idmap*])
88 dnl # Kernel 5.12 test
90 AC_MSG_CHECKING([whether iops->getattr() takes user_namespace])
91 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_userns], [
93 AC_DEFINE(HAVE_USERNS_IOPS_GETATTR, 1,
94 [iops->getattr() takes struct user_namespace*])
99 dnl # Kernel 4.11 test
101 AC_MSG_CHECKING([whether iops->getattr() takes a path])
102 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_path], [
104 AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
105 [iops->getattr() takes a path])
110 dnl # Kernel < 4.11 test
112 AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
113 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_vfsmount], [
115 AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
116 [iops->getattr() takes a vfsmount])