Add -p switch to "zpool get"
[zfs.git] / config / kernel-xattr-handler.m4
1 dnl #
2 dnl # 2.6.35 API change,
3 dnl # The 'struct xattr_handler' was constified in the generic
4 dnl # super_block structure.
5 dnl #
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([
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         ],[
22                 struct super_block sb __attribute__ ((unused));
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 ])
33
34 dnl #
35 dnl # 2.6.33 API change,
36 dnl # The xattr_hander->get() callback was changed to take a dentry
37 dnl # instead of an inode, and a handler_flags argument was added.
38 dnl #
39 AC_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;
46                 struct xattr_handler xops __attribute__ ((unused));
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
58 dnl #
59 dnl # 2.6.33 API change,
60 dnl # The xattr_hander->set() callback was changed to take a dentry
61 dnl # instead of an inode, and a handler_flags argument was added.
62 dnl #
63 AC_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;
71                 struct xattr_handler xops __attribute__ ((unused));
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 ])