2 dnl # Supported get_link() interfaces checked newest to oldest.
4 AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_LINK], [
7 dnl # - This kernel retired the nameidata structure.
9 AC_MSG_CHECKING([whether iops->follow_link() passes cookie])
10 ZFS_LINUX_TRY_COMPILE([
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,
21 AC_DEFINE(HAVE_FOLLOW_LINK_COOKIE, 1,
22 [iops->follow_link() cookie])
29 [whether iops->follow_link() passes nameidata])
30 ZFS_LINUX_TRY_COMPILE([
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,
41 AC_DEFINE(HAVE_FOLLOW_LINK_NAMEIDATA, 1,
42 [iops->follow_link() nameidata])
44 AC_MSG_ERROR(no; please file a bug report)
49 AC_DEFUN([ZFS_AC_KERNEL_GET_LINK], [
52 dnl # The get_link interface has added a delayed done call and
53 dnl # used it to retire the put_link() interface.
55 AC_MSG_CHECKING([whether iops->get_link() passes delayed])
56 ZFS_LINUX_TRY_COMPILE([
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)) = {
67 AC_DEFINE(HAVE_GET_LINK_DELAYED, 1,
68 [iops->get_link() delayed])
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.
78 AC_MSG_CHECKING([whether iops->get_link() passes cookie])
79 ZFS_LINUX_TRY_COMPILE([
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)) = {
90 AC_DEFINE(HAVE_GET_LINK_COOKIE, 1,
91 [iops->get_link() cookie])
94 dnl # Check for the follow_link APIs.
97 ZFS_AC_KERNEL_FOLLOW_LINK