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_CONST_XATTR_HANDLER], [
7 AC_MSG_CHECKING([whether super_block uses const struct xattr_handler])
8 ZFS_LINUX_TRY_COMPILE([
10 #include <linux/xattr.h>
12 const struct xattr_handler xattr_test_handler = {
18 const struct xattr_handler *xattr_handlers[] = {
22 const struct super_block sb __attribute__ ((unused)) = {
23 .s_xattr = xattr_handlers,
28 AC_DEFINE(HAVE_CONST_XATTR_HANDLER, 1,
29 [super_block uses const struct xattr_handler])
36 dnl # Supported xattr handler get() interfaces checked newest to oldest.
38 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
41 dnl # The xattr_handler->get() callback was changed to take a
42 dnl # attr_handler, and handler_flags argument was removed and
43 dnl # should be accessed by handler->flags.
45 AC_MSG_CHECKING([whether xattr_handler->get() wants xattr_handler])
46 ZFS_LINUX_TRY_COMPILE([
47 #include <linux/xattr.h>
49 int get(const struct xattr_handler *handler,
50 struct dentry *dentry, const char *name,
51 void *buffer, size_t size) { return 0; }
52 static const struct xattr_handler
53 xops __attribute__ ((unused)) = {
59 AC_DEFINE(HAVE_XATTR_GET_HANDLER, 1,
60 [xattr_handler->get() wants xattr_handler])
63 dnl # 2.6.33 API change,
64 dnl # The xattr_handler->get() callback was changed to take
65 dnl # a dentry instead of an inode, and a handler_flags
66 dnl # argument was added.
69 AC_MSG_CHECKING([whether xattr_handler->get() wants dentry])
70 ZFS_LINUX_TRY_COMPILE([
71 #include <linux/xattr.h>
73 int get(struct dentry *dentry, const char *name,
74 void *buffer, size_t size, int handler_flags)
76 static const struct xattr_handler
77 xops __attribute__ ((unused)) = {
83 AC_DEFINE(HAVE_XATTR_GET_DENTRY, 1,
84 [xattr_handler->get() wants dentry])
91 [whether xattr_handler->get() wants inode])
92 ZFS_LINUX_TRY_COMPILE([
93 #include <linux/xattr.h>
95 int get(struct inode *ip, const char *name,
96 void *buffer, size_t size) { return 0; }
97 static const struct xattr_handler
98 xops __attribute__ ((unused)) = {
104 AC_DEFINE(HAVE_XATTR_GET_INODE, 1,
105 [xattr_handler->get() wants inode])
107 AC_MSG_ERROR([no; please file a bug report])
114 dnl # Supported xattr handler set() interfaces checked newest to oldest.
116 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
118 dnl # 4.4 API change,
119 dnl # The xattr_handler->set() callback was changed to take a
120 dnl # xattr_handler, and handler_flags argument was removed and
121 dnl # should be accessed by handler->flags.
123 AC_MSG_CHECKING([whether xattr_handler->set() wants xattr_handler])
124 ZFS_LINUX_TRY_COMPILE([
125 #include <linux/xattr.h>
127 int set(const struct xattr_handler *handler,
128 struct dentry *dentry, const char *name,
129 const void *buffer, size_t size, int flags)
131 static const struct xattr_handler
132 xops __attribute__ ((unused)) = {
138 AC_DEFINE(HAVE_XATTR_SET_HANDLER, 1,
139 [xattr_handler->set() wants xattr_handler])
142 dnl # 2.6.33 API change,
143 dnl # The xattr_handler->set() callback was changed to take a
144 dnl # dentry instead of an inode, and a handler_flags
145 dnl # argument was added.
148 AC_MSG_CHECKING([whether xattr_handler->set() wants dentry])
149 ZFS_LINUX_TRY_COMPILE([
150 #include <linux/xattr.h>
152 int set(struct dentry *dentry, const char *name,
153 const void *buffer, size_t size, int flags,
154 int handler_flags) { return 0; }
155 static const struct xattr_handler
156 xops __attribute__ ((unused)) = {
162 AC_DEFINE(HAVE_XATTR_SET_DENTRY, 1,
163 [xattr_handler->set() wants dentry])
170 [whether xattr_handler->set() wants inode])
171 ZFS_LINUX_TRY_COMPILE([
172 #include <linux/xattr.h>
174 int set(struct inode *ip, const char *name,
175 const void *buffer, size_t size, int flags)
177 static const struct xattr_handler
178 xops __attribute__ ((unused)) = {
184 AC_DEFINE(HAVE_XATTR_SET_INODE, 1,
185 [xattr_handler->set() wants inode])
187 AC_MSG_ERROR([no; please file a bug report])
194 dnl # Supported xattr handler list() interfaces checked newest to oldest.
196 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [
197 dnl # 4.5 API change,
198 dnl # The xattr_handler->list() callback was changed to take only a
199 dnl # dentry and it only needs to return if it's accessable.
200 AC_MSG_CHECKING([whether xattr_handler->list() wants simple])
201 ZFS_LINUX_TRY_COMPILE([
202 #include <linux/xattr.h>
204 bool list(struct dentry *dentry) { return 0; }
205 static const struct xattr_handler
206 xops __attribute__ ((unused)) = {
212 AC_DEFINE(HAVE_XATTR_LIST_SIMPLE, 1,
213 [xattr_handler->list() wants simple])
216 dnl # 4.4 API change,
217 dnl # The xattr_handler->list() callback was changed to take a
218 dnl # xattr_handler, and handler_flags argument was removed
219 dnl # and should be accessed by handler->flags.
223 [whether xattr_handler->list() wants xattr_handler])
224 ZFS_LINUX_TRY_COMPILE([
225 #include <linux/xattr.h>
227 size_t list(const struct xattr_handler *handler,
228 struct dentry *dentry, char *list, size_t list_size,
229 const char *name, size_t name_len) { return 0; }
230 static const struct xattr_handler
231 xops __attribute__ ((unused)) = {
237 AC_DEFINE(HAVE_XATTR_LIST_HANDLER, 1,
238 [xattr_handler->list() wants xattr_handler])
241 dnl # 2.6.33 API change,
242 dnl # The xattr_handler->list() callback was changed
243 dnl # to take a dentry instead of an inode, and a
244 dnl # handler_flags argument was added.
248 [whether xattr_handler->list() wants dentry])
249 ZFS_LINUX_TRY_COMPILE([
250 #include <linux/xattr.h>
252 size_t list(struct dentry *dentry,
253 char *list, size_t list_size,
254 const char *name, size_t name_len,
255 int handler_flags) { return 0; }
256 static const struct xattr_handler
257 xops __attribute__ ((unused)) = {
263 AC_DEFINE(HAVE_XATTR_LIST_DENTRY, 1,
264 [xattr_handler->list() wants dentry])
271 [whether xattr_handler->list() wants inode])
272 ZFS_LINUX_TRY_COMPILE([
273 #include <linux/xattr.h>
275 size_t list(struct inode *ip, char *lst,
276 size_t list_size, const char *name,
277 size_t name_len) { return 0; }
278 static const struct xattr_handler
279 xops __attribute__ ((unused)) = {
285 AC_DEFINE(HAVE_XATTR_LIST_INODE, 1,
286 [xattr_handler->list() wants inode])
289 [no; please file a bug report])
297 dnl # 3.7 API change,
298 dnl # The posix_acl_{from,to}_xattr functions gained a new
299 dnl # parameter: user_ns
301 AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_FROM_XATTR_USERNS], [
302 AC_MSG_CHECKING([whether posix_acl_from_xattr() needs user_ns])
303 ZFS_LINUX_TRY_COMPILE([
304 #include <linux/cred.h>
305 #include <linux/fs.h>
306 #include <linux/posix_acl_xattr.h>
308 posix_acl_from_xattr(&init_user_ns, NULL, 0);
311 AC_DEFINE(HAVE_POSIX_ACL_FROM_XATTR_USERNS, 1,
312 [posix_acl_from_xattr() needs user_ns])