3 dnl # Added d_make_root() to replace previous d_alloc_root() function.
5 AC_DEFUN([ZFS_AC_KERNEL_SRC_D_MAKE_ROOT], [
6 ZFS_LINUX_TEST_SRC([d_make_root], [
7 #include <linux/dcache.h>
13 AC_DEFUN([ZFS_AC_KERNEL_D_MAKE_ROOT], [
14 AC_MSG_CHECKING([whether d_make_root() is available])
15 ZFS_LINUX_TEST_RESULT_SYMBOL([d_make_root],
16 [d_make_root], [fs/dcache.c], [
18 AC_DEFINE(HAVE_D_MAKE_ROOT, 1, [d_make_root() is available])
25 dnl # 2.6.28 API change
26 dnl # Added d_obtain_alias() helper function.
28 AC_DEFUN([ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS], [
29 ZFS_LINUX_TEST_SRC([d_obtain_alias], [
30 #include <linux/dcache.h>
36 AC_DEFUN([ZFS_AC_KERNEL_D_OBTAIN_ALIAS], [
37 AC_MSG_CHECKING([whether d_obtain_alias() is available])
38 ZFS_LINUX_TEST_RESULT_SYMBOL([d_obtain_alias],
39 [d_obtain_alias], [fs/dcache.c], [
42 ZFS_LINUX_TEST_ERROR([d_obtain_alias()])
47 dnl # 2.6.12 API change
48 dnl # d_prune_aliases() helper function available.
50 AC_DEFUN([ZFS_AC_KERNEL_SRC_D_PRUNE_ALIASES], [
51 ZFS_LINUX_TEST_SRC([d_prune_aliases], [
52 #include <linux/dcache.h>
54 struct inode *ip = NULL;
59 AC_DEFUN([ZFS_AC_KERNEL_D_PRUNE_ALIASES], [
60 AC_MSG_CHECKING([whether d_prune_aliases() is available])
61 ZFS_LINUX_TEST_RESULT_SYMBOL([d_prune_aliases],
62 [d_prune_aliases], [fs/dcache.c], [
64 AC_DEFINE(HAVE_D_PRUNE_ALIASES, 1,
65 [d_prune_aliases() is available])
67 ZFS_LINUX_TEST_ERROR([d_prune_aliases()])
72 dnl # 2.6.38 API change
73 dnl # Added d_set_d_op() helper function.
75 AC_DEFUN([ZFS_AC_KERNEL_SRC_D_SET_D_OP], [
76 ZFS_LINUX_TEST_SRC([d_set_d_op], [
77 #include <linux/dcache.h>
79 d_set_d_op(NULL, NULL);
83 AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP], [
84 AC_MSG_CHECKING([whether d_set_d_op() is available])
85 ZFS_LINUX_TEST_RESULT_SYMBOL([d_set_d_op],
86 [d_set_d_op], [fs/dcache.c], [
89 ZFS_LINUX_TEST_ERROR([d_set_d_op])
96 AC_DEFUN([ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA], [
97 ZFS_LINUX_TEST_SRC([dentry_operations_revalidate], [
98 #include <linux/dcache.h>
99 #include <linux/sched.h>
101 int revalidate (struct dentry *dentry,
102 struct nameidata *nidata) { return 0; }
104 static const struct dentry_operations
105 dops __attribute__ ((unused)) = {
106 .d_revalidate = revalidate,
111 AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
112 AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
113 ZFS_LINUX_TEST_RESULT([dentry_operations_revalidate], [
115 AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1,
116 [dops->d_revalidate() operation takes nameidata])
123 dnl # 2.6.30 API change
124 dnl # The 'struct dentry_operations' was constified in the dentry structure.
126 AC_DEFUN([ZFS_AC_KERNEL_SRC_CONST_DENTRY_OPERATIONS], [
127 ZFS_LINUX_TEST_SRC([dentry_operations_const], [
128 #include <linux/dcache.h>
130 const struct dentry_operations test_d_op = {
131 .d_revalidate = NULL,
134 struct dentry d __attribute__ ((unused));
139 AC_DEFUN([ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS], [
140 AC_MSG_CHECKING([whether dentry uses const struct dentry_operations])
141 ZFS_LINUX_TEST_RESULT([dentry_operations_const], [
143 AC_DEFINE(HAVE_CONST_DENTRY_OPERATIONS, 1,
144 [dentry uses const struct dentry_operations])
146 ZFS_LINUX_TEST_ERROR([const dentry_operations])
151 dnl # 2.6.38 API change
152 dnl # Added sb->s_d_op default dentry_operations member
154 AC_DEFUN([ZFS_AC_KERNEL_SRC_S_D_OP], [
155 ZFS_LINUX_TEST_SRC([super_block_s_d_op], [
156 #include <linux/fs.h>
158 struct super_block sb __attribute__ ((unused));
163 AC_DEFUN([ZFS_AC_KERNEL_S_D_OP], [
164 AC_MSG_CHECKING([whether super_block has s_d_op])
165 ZFS_LINUX_TEST_RESULT([super_block_s_d_op], [
168 ZFS_LINUX_TEST_ERROR([super_block s_d_op])
172 AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY], [
173 ZFS_AC_KERNEL_SRC_D_MAKE_ROOT
174 ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS
175 ZFS_AC_KERNEL_SRC_D_PRUNE_ALIASES
176 ZFS_AC_KERNEL_SRC_D_SET_D_OP
177 ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA
178 ZFS_AC_KERNEL_SRC_CONST_DENTRY_OPERATIONS
179 ZFS_AC_KERNEL_SRC_S_D_OP
182 AC_DEFUN([ZFS_AC_KERNEL_DENTRY], [
183 ZFS_AC_KERNEL_D_MAKE_ROOT
184 ZFS_AC_KERNEL_D_OBTAIN_ALIAS
185 ZFS_AC_KERNEL_D_PRUNE_ALIASES
186 ZFS_AC_KERNEL_D_SET_D_OP
187 ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA
188 ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS