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_hander])
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_hander])
36 dnl # 2.6.33 API change,
37 dnl # The xattr_hander->get() callback was changed to take a dentry
38 dnl # instead of an inode, and a handler_flags argument was added.
41 dnl # The xattr_hander->get() callback was changed to take a xattr_handler,
42 dnl # and handler_flags argument was removed and should be accessed by
45 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
46 AC_MSG_CHECKING([whether xattr_handler->get() wants dentry])
47 ZFS_LINUX_TRY_COMPILE([
48 #include <linux/xattr.h>
50 int get(struct dentry *dentry, const char *name,
51 void *buffer, size_t size, int handler_flags) { return 0; }
52 static const struct xattr_handler
53 xops __attribute__ ((unused)) = {
59 AC_DEFINE(HAVE_DENTRY_XATTR_GET, 1,
60 [xattr_handler->get() wants dentry])
63 AC_MSG_CHECKING([whether xattr_handler->get() wants xattr_handler])
64 ZFS_LINUX_TRY_COMPILE([
65 #include <linux/xattr.h>
67 int get(const struct xattr_handler *handler, struct dentry *dentry,
68 const char *name, void *buffer, size_t size) { return 0; }
69 static const struct xattr_handler
70 xops __attribute__ ((unused)) = {
76 AC_DEFINE(HAVE_HANDLER_XATTR_GET, 1,
77 [xattr_handler->get() wants xattr_handler])
85 dnl # 2.6.33 API change,
86 dnl # The xattr_hander->set() callback was changed to take a dentry
87 dnl # instead of an inode, and a handler_flags argument was added.
90 dnl # The xattr_hander->set() callback was changed to take a xattr_handler,
91 dnl # and handler_flags argument was removed and should be accessed by
94 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
95 AC_MSG_CHECKING([whether xattr_handler->set() wants dentry])
96 ZFS_LINUX_TRY_COMPILE([
97 #include <linux/xattr.h>
99 int set(struct dentry *dentry, const char *name,
100 const void *buffer, size_t size, int flags,
101 int handler_flags) { return 0; }
102 static const struct xattr_handler
103 xops __attribute__ ((unused)) = {
109 AC_DEFINE(HAVE_DENTRY_XATTR_SET, 1,
110 [xattr_handler->set() wants dentry])
113 AC_MSG_CHECKING([whether xattr_handler->set() wants xattr_handler])
114 ZFS_LINUX_TRY_COMPILE([
115 #include <linux/xattr.h>
117 int set(const struct xattr_handler *handler, struct dentry *dentry,
118 const char *name, const void *buffer, size_t size, int flags) { return 0; }
119 static const struct xattr_handler
120 xops __attribute__ ((unused)) = {
126 AC_DEFINE(HAVE_HANDLER_XATTR_SET, 1,
127 [xattr_handler->set() wants xattr_handler])
135 dnl # 2.6.33 API change,
136 dnl # The xattr_hander->list() callback was changed to take a dentry
137 dnl # instead of an inode, and a handler_flags argument was added.
139 dnl # 4.4 API change,
140 dnl # The xattr_hander->list() callback was changed to take a xattr_handler,
141 dnl # and handler_flags argument was removed and should be accessed by
142 dnl # handler->flags.
144 AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [
145 AC_MSG_CHECKING([whether xattr_handler->list() wants dentry])
146 ZFS_LINUX_TRY_COMPILE([
147 #include <linux/xattr.h>
149 size_t list(struct dentry *dentry, char *list, size_t list_size,
150 const char *name, size_t name_len, int handler_flags)
152 static const struct xattr_handler
153 xops __attribute__ ((unused)) = {
159 AC_DEFINE(HAVE_DENTRY_XATTR_LIST, 1,
160 [xattr_handler->list() wants dentry])
163 AC_MSG_CHECKING([whether xattr_handler->list() wants xattr_handler])
164 ZFS_LINUX_TRY_COMPILE([
165 #include <linux/xattr.h>
167 size_t list(const struct xattr_handler *handler, struct dentry *dentry,
168 char *list, size_t list_size, const char *name, size_t name_len) { return 0; }
169 static const struct xattr_handler
170 xops __attribute__ ((unused)) = {
176 AC_DEFINE(HAVE_HANDLER_XATTR_LIST, 1,
177 [xattr_handler->list() wants xattr_handler])
185 dnl # 3.7 API change,
186 dnl # The posix_acl_{from,to}_xattr functions gained a new
187 dnl # parameter: user_ns
189 AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_FROM_XATTR_USERNS], [
190 AC_MSG_CHECKING([whether posix_acl_from_xattr() needs user_ns])
191 ZFS_LINUX_TRY_COMPILE([
192 #include <linux/cred.h>
193 #include <linux/fs.h>
194 #include <linux/posix_acl_xattr.h>
196 posix_acl_from_xattr(&init_user_ns, NULL, 0);
199 AC_DEFINE(HAVE_POSIX_ACL_FROM_XATTR_USERNS, 1,
200 [posix_acl_from_xattr() needs user_ns])