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])
37 dnl # struct xattr_handler added new member "name".
38 dnl # xattr_handler which matches to whole name rather than prefix should use
39 dnl # "name" instead of "prefix", e.g. "system.posix_acl_access"
41 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_NAME], [
42 AC_MSG_CHECKING([whether xattr_handler has name])
43 ZFS_LINUX_TRY_COMPILE([
44 #include <linux/xattr.h>
46 static const struct xattr_handler
47 xops __attribute__ ((unused)) = {
48 .name = XATTR_NAME_POSIX_ACL_ACCESS,
53 AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1,
54 [xattr_handler has name])
61 dnl # Supported xattr handler get() interfaces checked newest to oldest.
63 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
66 dnl # The xattr_handler->get() callback was changed to take a
67 dnl # attr_handler, and handler_flags argument was removed and
68 dnl # should be accessed by handler->flags.
70 AC_MSG_CHECKING([whether xattr_handler->get() wants xattr_handler])
71 ZFS_LINUX_TRY_COMPILE([
72 #include <linux/xattr.h>
74 int get(const struct xattr_handler *handler,
75 struct dentry *dentry, const char *name,
76 void *buffer, size_t size) { return 0; }
77 static const struct xattr_handler
78 xops __attribute__ ((unused)) = {
84 AC_DEFINE(HAVE_XATTR_GET_HANDLER, 1,
85 [xattr_handler->get() wants xattr_handler])
88 dnl # 2.6.33 API change,
89 dnl # The xattr_handler->get() callback was changed to take
90 dnl # a dentry instead of an inode, and a handler_flags
91 dnl # argument was added.
94 AC_MSG_CHECKING([whether xattr_handler->get() wants dentry])
95 ZFS_LINUX_TRY_COMPILE([
96 #include <linux/xattr.h>
98 int get(struct dentry *dentry, const char *name,
99 void *buffer, size_t size, int handler_flags)
101 static const struct xattr_handler
102 xops __attribute__ ((unused)) = {
108 AC_DEFINE(HAVE_XATTR_GET_DENTRY, 1,
109 [xattr_handler->get() wants dentry])
116 [whether xattr_handler->get() wants inode])
117 ZFS_LINUX_TRY_COMPILE([
118 #include <linux/xattr.h>
120 int get(struct inode *ip, const char *name,
121 void *buffer, size_t size) { return 0; }
122 static const struct xattr_handler
123 xops __attribute__ ((unused)) = {
129 AC_DEFINE(HAVE_XATTR_GET_INODE, 1,
130 [xattr_handler->get() wants inode])
132 AC_MSG_ERROR([no; please file a bug report])
139 dnl # Supported xattr handler set() interfaces checked newest to oldest.
141 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
143 dnl # 4.4 API change,
144 dnl # The xattr_handler->set() callback was changed to take a
145 dnl # xattr_handler, and handler_flags argument was removed and
146 dnl # should be accessed by handler->flags.
148 AC_MSG_CHECKING([whether xattr_handler->set() wants xattr_handler])
149 ZFS_LINUX_TRY_COMPILE([
150 #include <linux/xattr.h>
152 int set(const struct xattr_handler *handler,
153 struct dentry *dentry, const char *name,
154 const void *buffer, size_t size, int flags)
156 static const struct xattr_handler
157 xops __attribute__ ((unused)) = {
163 AC_DEFINE(HAVE_XATTR_SET_HANDLER, 1,
164 [xattr_handler->set() wants xattr_handler])
167 dnl # 2.6.33 API change,
168 dnl # The xattr_handler->set() callback was changed to take a
169 dnl # dentry instead of an inode, and a handler_flags
170 dnl # argument was added.
173 AC_MSG_CHECKING([whether xattr_handler->set() wants dentry])
174 ZFS_LINUX_TRY_COMPILE([
175 #include <linux/xattr.h>
177 int set(struct dentry *dentry, const char *name,
178 const void *buffer, size_t size, int flags,
179 int handler_flags) { return 0; }
180 static const struct xattr_handler
181 xops __attribute__ ((unused)) = {
187 AC_DEFINE(HAVE_XATTR_SET_DENTRY, 1,
188 [xattr_handler->set() wants dentry])
195 [whether xattr_handler->set() wants inode])
196 ZFS_LINUX_TRY_COMPILE([
197 #include <linux/xattr.h>
199 int set(struct inode *ip, const char *name,
200 const void *buffer, size_t size, int flags)
202 static const struct xattr_handler
203 xops __attribute__ ((unused)) = {
209 AC_DEFINE(HAVE_XATTR_SET_INODE, 1,
210 [xattr_handler->set() wants inode])
212 AC_MSG_ERROR([no; please file a bug report])
219 dnl # Supported xattr handler list() interfaces checked newest to oldest.
221 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [
222 dnl # 4.5 API change,
223 dnl # The xattr_handler->list() callback was changed to take only a
224 dnl # dentry and it only needs to return if it's accessable.
225 AC_MSG_CHECKING([whether xattr_handler->list() wants simple])
226 ZFS_LINUX_TRY_COMPILE([
227 #include <linux/xattr.h>
229 bool list(struct dentry *dentry) { return 0; }
230 static const struct xattr_handler
231 xops __attribute__ ((unused)) = {
237 AC_DEFINE(HAVE_XATTR_LIST_SIMPLE, 1,
238 [xattr_handler->list() wants simple])
241 dnl # 4.4 API change,
242 dnl # The xattr_handler->list() callback was changed to take a
243 dnl # xattr_handler, and handler_flags argument was removed
244 dnl # and should be accessed by handler->flags.
248 [whether xattr_handler->list() wants xattr_handler])
249 ZFS_LINUX_TRY_COMPILE([
250 #include <linux/xattr.h>
252 size_t list(const struct xattr_handler *handler,
253 struct dentry *dentry, char *list, size_t list_size,
254 const char *name, size_t name_len) { return 0; }
255 static const struct xattr_handler
256 xops __attribute__ ((unused)) = {
262 AC_DEFINE(HAVE_XATTR_LIST_HANDLER, 1,
263 [xattr_handler->list() wants xattr_handler])
266 dnl # 2.6.33 API change,
267 dnl # The xattr_handler->list() callback was changed
268 dnl # to take a dentry instead of an inode, and a
269 dnl # handler_flags argument was added.
273 [whether xattr_handler->list() wants dentry])
274 ZFS_LINUX_TRY_COMPILE([
275 #include <linux/xattr.h>
277 size_t list(struct dentry *dentry,
278 char *list, size_t list_size,
279 const char *name, size_t name_len,
280 int handler_flags) { return 0; }
281 static const struct xattr_handler
282 xops __attribute__ ((unused)) = {
288 AC_DEFINE(HAVE_XATTR_LIST_DENTRY, 1,
289 [xattr_handler->list() wants dentry])
296 [whether xattr_handler->list() wants inode])
297 ZFS_LINUX_TRY_COMPILE([
298 #include <linux/xattr.h>
300 size_t list(struct inode *ip, char *lst,
301 size_t list_size, const char *name,
302 size_t name_len) { return 0; }
303 static const struct xattr_handler
304 xops __attribute__ ((unused)) = {
310 AC_DEFINE(HAVE_XATTR_LIST_INODE, 1,
311 [xattr_handler->list() wants inode])
314 [no; please file a bug report])
322 dnl # 3.7 API change,
323 dnl # The posix_acl_{from,to}_xattr functions gained a new
324 dnl # parameter: user_ns
326 AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_FROM_XATTR_USERNS], [
327 AC_MSG_CHECKING([whether posix_acl_from_xattr() needs user_ns])
328 ZFS_LINUX_TRY_COMPILE([
329 #include <linux/cred.h>
330 #include <linux/fs.h>
331 #include <linux/posix_acl_xattr.h>
333 posix_acl_from_xattr(&init_user_ns, NULL, 0);
336 AC_DEFINE(HAVE_POSIX_ACL_FROM_XATTR_USERNS, 1,
337 [posix_acl_from_xattr() needs user_ns])