]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-get-link.m4
FreeBSD: Add zfs_link_create() error handling
[mirror_zfs.git] / config / kernel-get-link.m4
CommitLineData
beeed459
BB
1dnl #
2dnl # Supported get_link() interfaces checked newest to oldest.
608f8749 3dnl # Note this interface used to be named follow_link.
beeed459 4dnl #
608f8749
BB
5AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_LINK], [
6 ZFS_LINUX_TEST_SRC([inode_operations_get_link], [
7 #include <linux/fs.h>
a41d0b29 8 static const char *get_link(struct dentry *de, struct inode *ip,
608f8749
BB
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>
a41d0b29 18 static const char *get_link(struct dentry *de, struct
608f8749
BB
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 27 #include <linux/fs.h>
a41d0b29 28 static const char *follow_link(struct dentry *de,
beeed459
BB
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>
a41d0b29 38 static void *follow_link(struct dentry *de, struct
608f8749
BB
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
47AC_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])