2 dnl # 2.6.35 API change,
3 dnl # The 'struct xattr_handler' was constified in the generic
4 dnl # super_block structure.
6 AC_DEFUN([ZFS_AC_KERNEL_SRC_CONST_XATTR_HANDLER], [
7 ZFS_LINUX_TEST_SRC([const_xattr_handler], [
9 #include <linux/xattr.h>
11 const struct xattr_handler xattr_test_handler = {
17 const struct xattr_handler *xattr_handlers[] = {
21 const struct super_block sb __attribute__ ((unused)) = {
22 .s_xattr = xattr_handlers,
27 AC_DEFUN([ZFS_AC_KERNEL_CONST_XATTR_HANDLER], [
28 AC_MSG_CHECKING([whether super_block uses const struct xattr_handler])
29 ZFS_LINUX_TEST_RESULT([const_xattr_handler], [
32 ZFS_LINUX_TEST_ERROR([const xattr_handler])
37 dnl # Android API change,
38 dnl # The xattr_handler->get() callback was
39 dnl # changed to take dentry, inode and flags.
41 AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS], [
42 ZFS_LINUX_TEST_SRC([xattr_handler_get_dentry_inode_flags], [
43 #include <linux/xattr.h>
45 static int get(const struct xattr_handler *handler,
46 struct dentry *dentry, struct inode *inode,
47 const char *name, void *buffer,
48 size_t size, int flags) { return 0; }
49 static const struct xattr_handler
50 xops __attribute__ ((unused)) = {
56 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS], [
59 [whether xattr_handler->get() wants dentry and inode and flags])
60 ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry_inode_flags], [
62 AC_DEFINE(HAVE_XATTR_GET_DENTRY_INODE_FLAGS, 1,
63 [xattr_handler->get() wants dentry and inode and flags])
70 dnl # Supported xattr handler set() interfaces checked newest to oldest.
72 AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET], [
73 ZFS_LINUX_TEST_SRC([xattr_handler_set_mnt_idmap], [
74 #include <linux/xattr.h>
76 static int set(const struct xattr_handler *handler,
77 struct mnt_idmap *idmap,
78 struct dentry *dentry, struct inode *inode,
79 const char *name, const void *buffer,
80 size_t size, int flags)
82 static const struct xattr_handler
83 xops __attribute__ ((unused)) = {
88 ZFS_LINUX_TEST_SRC([xattr_handler_set_userns], [
89 #include <linux/xattr.h>
91 static int set(const struct xattr_handler *handler,
92 struct user_namespace *mnt_userns,
93 struct dentry *dentry, struct inode *inode,
94 const char *name, const void *buffer,
95 size_t size, int flags)
97 static const struct xattr_handler
98 xops __attribute__ ((unused)) = {
103 ZFS_LINUX_TEST_SRC([xattr_handler_set_dentry_inode], [
104 #include <linux/xattr.h>
106 static int set(const struct xattr_handler *handler,
107 struct dentry *dentry, struct inode *inode,
108 const char *name, const void *buffer,
109 size_t size, int flags)
111 static const struct xattr_handler
112 xops __attribute__ ((unused)) = {
118 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
120 dnl # 5.12 API change,
121 dnl # The xattr_handler->set() callback was changed to 8 arguments, and
122 dnl # struct user_namespace* was inserted as arg #2
124 dnl # 6.3 API change,
125 dnl # The xattr_handler->set() callback 2nd arg is now struct mnt_idmap *
127 AC_MSG_CHECKING([whether xattr_handler->set() wants dentry, inode, and mnt_idmap])
128 ZFS_LINUX_TEST_RESULT([xattr_handler_set_mnt_idmap], [
130 AC_DEFINE(HAVE_XATTR_SET_IDMAP, 1,
131 [xattr_handler->set() takes mnt_idmap])
134 AC_MSG_CHECKING([whether xattr_handler->set() wants dentry, inode, and user_namespace])
135 ZFS_LINUX_TEST_RESULT([xattr_handler_set_userns], [
137 AC_DEFINE(HAVE_XATTR_SET_USERNS, 1,
138 [xattr_handler->set() takes user_namespace])
141 dnl # 4.7 API change,
142 dnl # The xattr_handler->set() callback was changed to take both
143 dnl # dentry and inode.
146 AC_MSG_CHECKING([whether xattr_handler->set() wants dentry and inode])
147 ZFS_LINUX_TEST_RESULT([xattr_handler_set_dentry_inode], [
149 AC_DEFINE(HAVE_XATTR_SET_DENTRY_INODE, 1,
150 [xattr_handler->set() wants both dentry and inode])
152 ZFS_LINUX_TEST_ERROR([xattr set()])
159 dnl # 4.9 API change,
160 dnl # iops->{set,get,remove}xattr and generic_{set,get,remove}xattr are
161 dnl # removed. xattr operations will directly go through sb->s_xattr.
163 AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_SETXATTR], [
164 ZFS_LINUX_TEST_SRC([have_generic_setxattr], [
165 #include <linux/fs.h>
166 #include <linux/xattr.h>
168 static const struct inode_operations
169 iops __attribute__ ((unused)) = {
170 .setxattr = generic_setxattr
175 AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR], [
176 ZFS_AC_KERNEL_SRC_CONST_XATTR_HANDLER
177 ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS
178 ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET
181 AC_DEFUN([ZFS_AC_KERNEL_XATTR], [
182 ZFS_AC_KERNEL_CONST_XATTR_HANDLER
183 ZFS_AC_KERNEL_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS
184 ZFS_AC_KERNEL_XATTR_HANDLER_SET