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