]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-inode-getattr.m4
FreeBSD: Add zfs_link_create() error handling
[mirror_zfs.git] / config / kernel-inode-getattr.m4
CommitLineData
608f8749 1AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
d4dc53da
YY
2 dnl #
3 dnl # Linux 6.3 API
4 dnl # The first arg of getattr I/O operations handler type
5 dnl # is changed to struct mnt_idmap*
6 dnl #
7 ZFS_LINUX_TEST_SRC([inode_operations_getattr_mnt_idmap], [
8 #include <linux/fs.h>
9
a41d0b29 10 static int test_getattr(
d4dc53da
YY
11 struct mnt_idmap *idmap,
12 const struct path *p, struct kstat *k,
13 u32 request_mask, unsigned int query_flags)
14 { return 0; }
15
16 static const struct inode_operations
17 iops __attribute__ ((unused)) = {
18 .getattr = test_getattr,
19 };
20 ],[])
21
e2a82961
CK
22 dnl #
23 dnl # Linux 5.12 API
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
26 dnl # mounts.
27 dnl #
28 ZFS_LINUX_TEST_SRC([inode_operations_getattr_userns], [
29 #include <linux/fs.h>
30
a41d0b29 31 static int test_getattr(
e2a82961
CK
32 struct user_namespace *userns,
33 const struct path *p, struct kstat *k,
34 u32 request_mask, unsigned int query_flags)
35 { return 0; }
36
37 static const struct inode_operations
38 iops __attribute__ ((unused)) = {
39 .getattr = test_getattr,
40 };
41 ],[])
42
43 dnl #
44 dnl # Linux 4.11 API
45 dnl # See torvalds/linux@a528d35
46 dnl #
608f8749 47 ZFS_LINUX_TEST_SRC([inode_operations_getattr_path], [
a3478c07
OF
48 #include <linux/fs.h>
49
a41d0b29 50 static int test_getattr(
a3478c07
OF
51 const struct path *p, struct kstat *k,
52 u32 request_mask, unsigned int query_flags)
53 { return 0; }
54
55 static const struct inode_operations
56 iops __attribute__ ((unused)) = {
57 .getattr = test_getattr,
58 };
608f8749 59 ],[])
a3478c07 60
608f8749 61 ZFS_LINUX_TEST_SRC([inode_operations_getattr_vfsmount], [
a3478c07
OF
62 #include <linux/fs.h>
63
a41d0b29 64 static int test_getattr(
a3478c07
OF
65 struct vfsmount *mnt, struct dentry *d,
66 struct kstat *k)
67 { return 0; }
68
69 static const struct inode_operations
70 iops __attribute__ ((unused)) = {
71 .getattr = test_getattr,
72 };
608f8749
BB
73 ],[])
74])
75
76AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
e2a82961 77 dnl #
d4dc53da 78 dnl # Kernel 6.3 test
e2a82961 79 dnl #
d4dc53da
YY
80 AC_MSG_CHECKING([whether iops->getattr() takes mnt_idmap])
81 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_mnt_idmap], [
a3478c07 82 AC_MSG_RESULT(yes)
d4dc53da
YY
83 AC_DEFINE(HAVE_IDMAP_IOPS_GETATTR, 1,
84 [iops->getattr() takes struct mnt_idmap*])
a3478c07
OF
85 ],[
86 AC_MSG_RESULT(no)
e2a82961 87 dnl #
d4dc53da 88 dnl # Kernel 5.12 test
e2a82961 89 dnl #
d4dc53da
YY
90 AC_MSG_CHECKING([whether iops->getattr() takes user_namespace])
91 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_userns], [
608f8749 92 AC_MSG_RESULT(yes)
d4dc53da
YY
93 AC_DEFINE(HAVE_USERNS_IOPS_GETATTR, 1,
94 [iops->getattr() takes struct user_namespace*])
608f8749
BB
95 ],[
96 AC_MSG_RESULT(no)
e2a82961
CK
97
98 dnl #
d4dc53da 99 dnl # Kernel 4.11 test
e2a82961 100 dnl #
d4dc53da
YY
101 AC_MSG_CHECKING([whether iops->getattr() takes a path])
102 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_path], [
e2a82961 103 AC_MSG_RESULT(yes)
d4dc53da
YY
104 AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
105 [iops->getattr() takes a path])
e2a82961
CK
106 ],[
107 AC_MSG_RESULT(no)
d4dc53da
YY
108
109 dnl #
110 dnl # Kernel < 4.11 test
111 dnl #
112 AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
113 ZFS_LINUX_TEST_RESULT([inode_operations_getattr_vfsmount], [
114 AC_MSG_RESULT(yes)
115 AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
116 [iops->getattr() takes a vfsmount])
117 ],[
118 AC_MSG_RESULT(no)
119 ])
e2a82961 120 ])
608f8749
BB
121 ])
122 ])
a3478c07 123])