]> git.proxmox.com Git - mirror_zfs.git/blob - config/kernel-get-link.m4
Don't assume pthread_t is uint_t for portability
[mirror_zfs.git] / config / kernel-get-link.m4
1 dnl #
2 dnl # Supported get_link() interfaces checked newest to oldest.
3 dnl #
4 AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_LINK], [
5 dnl #
6 dnl # 4.2 API change
7 dnl # - This kernel retired the nameidata structure.
8 dnl #
9 AC_MSG_CHECKING([whether iops->follow_link() passes cookie])
10 ZFS_LINUX_TRY_COMPILE([
11 #include <linux/fs.h>
12 const char *follow_link(struct dentry *de,
13 void **cookie) { return "symlink"; }
14 static struct inode_operations
15 iops __attribute__ ((unused)) = {
16 .follow_link = follow_link,
17 };
18 ],[
19 ],[
20 AC_MSG_RESULT(yes)
21 AC_DEFINE(HAVE_FOLLOW_LINK_COOKIE, 1,
22 [iops->follow_link() cookie])
23 ],[
24 dnl #
25 dnl # 2.6.32 API
26 dnl #
27 AC_MSG_RESULT(no)
28 AC_MSG_CHECKING(
29 [whether iops->follow_link() passes nameidata])
30 ZFS_LINUX_TRY_COMPILE([
31 #include <linux/fs.h>
32 void *follow_link(struct dentry *de, struct
33 nameidata *nd) { return (void *)NULL; }
34 static struct inode_operations
35 iops __attribute__ ((unused)) = {
36 .follow_link = follow_link,
37 };
38 ],[
39 ],[
40 AC_MSG_RESULT(yes)
41 AC_DEFINE(HAVE_FOLLOW_LINK_NAMEIDATA, 1,
42 [iops->follow_link() nameidata])
43 ],[
44 AC_MSG_ERROR(no; please file a bug report)
45 ])
46 ])
47 ])
48
49 AC_DEFUN([ZFS_AC_KERNEL_GET_LINK], [
50 dnl #
51 dnl # 4.5 API change
52 dnl # The get_link interface has added a delayed done call and
53 dnl # used it to retire the put_link() interface.
54 dnl #
55 AC_MSG_CHECKING([whether iops->get_link() passes delayed])
56 ZFS_LINUX_TRY_COMPILE([
57 #include <linux/fs.h>
58 const char *get_link(struct dentry *de, struct inode *ip,
59 struct delayed_call *done) { return "symlink"; }
60 static struct inode_operations
61 iops __attribute__ ((unused)) = {
62 .get_link = get_link,
63 };
64 ],[
65 ],[
66 AC_MSG_RESULT(yes)
67 AC_DEFINE(HAVE_GET_LINK_DELAYED, 1,
68 [iops->get_link() delayed])
69 ],[
70 dnl #
71 dnl # 4.5 API change
72 dnl # The follow_link() interface has been replaced by
73 dnl # get_link() which behaves the same as before except:
74 dnl # - An inode is passed as a separate argument
75 dnl # - When called in RCU mode a NULL dentry is passed.
76 dnl #
77 AC_MSG_RESULT(no)
78 AC_MSG_CHECKING([whether iops->get_link() passes cookie])
79 ZFS_LINUX_TRY_COMPILE([
80 #include <linux/fs.h>
81 const char *get_link(struct dentry *de, struct
82 inode *ip, void **cookie) { return "symlink"; }
83 static struct inode_operations
84 iops __attribute__ ((unused)) = {
85 .get_link = get_link,
86 };
87 ],[
88 ],[
89 AC_MSG_RESULT(yes)
90 AC_DEFINE(HAVE_GET_LINK_COOKIE, 1,
91 [iops->get_link() cookie])
92 ],[
93 dnl #
94 dnl # Check for the follow_link APIs.
95 dnl #
96 AC_MSG_RESULT(no)
97 ZFS_AC_KERNEL_FOLLOW_LINK
98 ])
99 ])
100 ])