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], [
10 static int test_getattr(
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], [
31 static int test_getattr(
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], [
50 static int test_getattr(
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,
62 AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
66 AC_MSG_CHECKING([whether iops->getattr() takes mnt_idmap])
67 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_mnt_idmap], [
69 AC_DEFINE(HAVE_IDMAP_IOPS_GETATTR, 1,
70 [iops->getattr() takes struct mnt_idmap*])
74 dnl # Kernel 5.12 test
76 AC_MSG_CHECKING([whether iops->getattr() takes user_namespace])
77 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_userns], [
79 AC_DEFINE(HAVE_USERNS_IOPS_GETATTR, 1,
80 [iops->getattr() takes struct user_namespace*])
85 dnl # Kernel 4.11 test
87 AC_MSG_CHECKING([whether iops->getattr() takes a path])
88 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_path], [
90 AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
91 [iops->getattr() takes a path])