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