]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-xattr-handler.m4
Fix dmu_objset_find_dp() KM_SLEEP warning
[mirror_zfs.git] / config / kernel-xattr-handler.m4
CommitLineData
777d4af8
BB
1dnl #
2dnl # 2.6.35 API change,
3dnl # The 'struct xattr_handler' was constified in the generic
4dnl # super_block structure.
5dnl #
6AC_DEFUN([ZFS_AC_KERNEL_CONST_XATTR_HANDLER],
7 [AC_MSG_CHECKING([whether super_block uses const struct xattr_hander])
8 ZFS_LINUX_TRY_COMPILE([
9 #include <linux/fs.h>
10 #include <linux/xattr.h>
11
12 const struct xattr_handler xattr_test_handler = {
13 .prefix = "test",
14 .get = NULL,
15 .set = NULL,
16 };
17
18 const struct xattr_handler *xattr_handlers[] = {
19 &xattr_test_handler,
20 };
21 ],[
79713039 22 struct super_block sb __attribute__ ((unused));
777d4af8
BB
23
24 sb.s_xattr = xattr_handlers;
25 ],[
26 AC_MSG_RESULT([yes])
27 AC_DEFINE(HAVE_CONST_XATTR_HANDLER, 1,
28 [super_block uses const struct xattr_hander])
29 ],[
30 AC_MSG_RESULT([no])
31 ])
32])
f9637c6c
BB
33
34dnl #
35dnl # 2.6.33 API change,
36dnl # The xattr_hander->get() callback was changed to take a dentry
37dnl # instead of an inode, and a handler_flags argument was added.
38dnl #
39AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
40 AC_MSG_CHECKING([whether xattr_handler->get() wants dentry])
41 ZFS_LINUX_TRY_COMPILE([
42 #include <linux/xattr.h>
43 ],[
44 int (*get)(struct dentry *dentry, const char *name,
45 void *buffer, size_t size, int handler_flags) = NULL;
79713039 46 struct xattr_handler xops __attribute__ ((unused));
f9637c6c
BB
47
48 xops.get = get;
49 ],[
50 AC_MSG_RESULT(yes)
51 AC_DEFINE(HAVE_DENTRY_XATTR_GET, 1,
52 [xattr_handler->get() wants dentry])
53 ],[
54 AC_MSG_RESULT(no)
55 ])
56])
57
58dnl #
59dnl # 2.6.33 API change,
60dnl # The xattr_hander->set() callback was changed to take a dentry
61dnl # instead of an inode, and a handler_flags argument was added.
62dnl #
63AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
64 AC_MSG_CHECKING([whether xattr_handler->set() wants dentry])
65 ZFS_LINUX_TRY_COMPILE([
66 #include <linux/xattr.h>
67 ],[
68 int (*set)(struct dentry *dentry, const char *name,
69 const void *buffer, size_t size, int flags,
70 int handler_flags) = NULL;
79713039 71 struct xattr_handler xops __attribute__ ((unused));
f9637c6c
BB
72
73 xops.set = set;
74 ],[
75 AC_MSG_RESULT(yes)
76 AC_DEFINE(HAVE_DENTRY_XATTR_SET, 1,
77 [xattr_handler->set() wants dentry])
78 ],[
79 AC_MSG_RESULT(no)
80 ])
81])