]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-xattr-handler.m4
Improve xattr property documentation
[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 };
777d4af8 21
b83e3e48
RY
22 const struct super_block sb __attribute__ ((unused)) = {
23 .s_xattr = xattr_handlers,
24 };
25 ],[
777d4af8
BB
26 ],[
27 AC_MSG_RESULT([yes])
28 AC_DEFINE(HAVE_CONST_XATTR_HANDLER, 1,
29 [super_block uses const struct xattr_hander])
30 ],[
31 AC_MSG_RESULT([no])
32 ])
33])
f9637c6c
BB
34
35dnl #
36dnl # 2.6.33 API change,
37dnl # The xattr_hander->get() callback was changed to take a dentry
38dnl # instead of an inode, and a handler_flags argument was added.
39dnl #
40AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
41 AC_MSG_CHECKING([whether xattr_handler->get() wants dentry])
42 ZFS_LINUX_TRY_COMPILE([
43 #include <linux/xattr.h>
f9637c6c 44
b83e3e48
RY
45 int get(struct dentry *dentry, const char *name,
46 void *buffer, size_t size, int handler_flags) { return 0; }
47 static const struct xattr_handler
48 xops __attribute__ ((unused)) = {
49 .get = get,
50 };
51 ],[
f9637c6c
BB
52 ],[
53 AC_MSG_RESULT(yes)
54 AC_DEFINE(HAVE_DENTRY_XATTR_GET, 1,
55 [xattr_handler->get() wants dentry])
56 ],[
57 AC_MSG_RESULT(no)
58 ])
59])
60
61dnl #
62dnl # 2.6.33 API change,
63dnl # The xattr_hander->set() callback was changed to take a dentry
64dnl # instead of an inode, and a handler_flags argument was added.
65dnl #
66AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
67 AC_MSG_CHECKING([whether xattr_handler->set() wants dentry])
68 ZFS_LINUX_TRY_COMPILE([
69 #include <linux/xattr.h>
f9637c6c 70
b83e3e48
RY
71 int set(struct dentry *dentry, const char *name,
72 const void *buffer, size_t size, int flags,
73 int handler_flags) { return 0; }
74 static const struct xattr_handler
75 xops __attribute__ ((unused)) = {
76 .set = set,
77 };
78 ],[
f9637c6c
BB
79 ],[
80 AC_MSG_RESULT(yes)
81 AC_DEFINE(HAVE_DENTRY_XATTR_SET, 1,
82 [xattr_handler->set() wants dentry])
83 ],[
84 AC_MSG_RESULT(no)
85 ])
86])