]> git.proxmox.com Git - mirror_zfs-debian.git/blob - config/kernel-dentry-operations.m4
3182490c908c8737bd33f072efc35cd1dce61d16
[mirror_zfs-debian.git] / config / kernel-dentry-operations.m4
1 dnl #
2 dnl # 3.6 API change
3 dnl #
4 AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
5 AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
6 ZFS_LINUX_TRY_COMPILE([
7 #include <linux/dcache.h>
8
9 int revalidate (struct dentry *dentry,
10 struct nameidata *nidata) { return 0; }
11
12 static const struct dentry_operations
13 dops __attribute__ ((unused)) = {
14 .d_revalidate = revalidate,
15 };
16 ],[
17 ],[
18 AC_MSG_RESULT(yes)
19 AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1,
20 [dops->d_revalidate() operation takes nameidata])
21 ],[
22 AC_MSG_RESULT(no)
23 ])
24 ])
25
26 dnl #
27 dnl # 2.6.30 API change
28 dnl # The 'struct dentry_operations' was constified in the dentry structure.
29 dnl #
30 AC_DEFUN([ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS], [
31 AC_MSG_CHECKING([whether dentry uses const struct dentry_operations])
32 ZFS_LINUX_TRY_COMPILE([
33 #include <linux/dcache.h>
34
35 const struct dentry_operations test_d_op = {
36 .d_revalidate = NULL,
37 };
38 ],[
39 struct dentry d __attribute__ ((unused));
40
41 d.d_op = &test_d_op;
42 ],[
43 AC_MSG_RESULT(yes)
44 AC_DEFINE(HAVE_CONST_DENTRY_OPERATIONS, 1,
45 [dentry uses const struct dentry_operations])
46 ],[
47 AC_MSG_RESULT(no)
48 ])
49 ])
50
51 dnl #
52 dnl # 2.6.38 API change
53 dnl # Added d_set_d_op() helper function.
54 dnl #
55 AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP],
56 [AC_MSG_CHECKING([whether d_set_d_op() is available])
57 ZFS_LINUX_TRY_COMPILE_SYMBOL([
58 #include <linux/dcache.h>
59 ], [
60 d_set_d_op(NULL, NULL);
61 ], [d_set_d_op], [fs/dcache.c], [
62 AC_MSG_RESULT(yes)
63 AC_DEFINE(HAVE_D_SET_D_OP, 1,
64 [d_set_d_op() is available])
65 ], [
66 AC_MSG_RESULT(no)
67 ])
68 ])
69
70 dnl #
71 dnl # 2.6.38 API chage
72 dnl # Added sb->s_d_op default dentry_operations member
73 dnl #
74 AC_DEFUN([ZFS_AC_KERNEL_S_D_OP],
75 [AC_MSG_CHECKING([whether super_block has s_d_op])
76 ZFS_LINUX_TRY_COMPILE([
77 #include <linux/fs.h>
78 ],[
79 struct super_block sb __attribute__ ((unused));
80 sb.s_d_op = NULL;
81 ], [
82 AC_MSG_RESULT(yes)
83 AC_DEFINE(HAVE_S_D_OP, 1, [struct super_block has s_d_op])
84 ], [
85 AC_MSG_RESULT(no)
86 ])
87 ])