1dnl #
2dnl # Supported symlink APIs
3dnl #
4AC_DEFUN([ZFS_AC_KERNEL_SRC_PUT_LINK], [
5	ZFS_LINUX_TEST_SRC([put_link_cookie], [
6		#include <linux/fs.h>
7		void put_link(struct inode *ip, void *cookie)
8		    { return; }
9		static struct inode_operations
10		    iops __attribute__ ((unused)) = {
11			.put_link = put_link,
12		};
13	],[])
14
15	ZFS_LINUX_TEST_SRC([put_link_nameidata], [
16		#include <linux/fs.h>
17		void put_link(struct dentry *de, struct
18		    nameidata *nd, void *ptr) { return; }
19		static struct inode_operations
20		    iops __attribute__ ((unused)) = {
21			.put_link = put_link,
22		};
23	],[])
24])
25
26AC_DEFUN([ZFS_AC_KERNEL_PUT_LINK], [
27	dnl #
28	dnl # 4.5 API change
29	dnl # get_link() uses delayed done, there is no put_link() interface.
30	dnl # This check initially uses the inode_operations_get_link result
31	dnl #
32	ZFS_LINUX_TEST_RESULT([inode_operations_get_link], [
33		AC_DEFINE(HAVE_PUT_LINK_DELAYED, 1, [iops->put_link() delayed])
34	],[
35		dnl #
36		dnl # 4.2 API change
37		dnl # This kernel retired the nameidata structure.
38		dnl #
39		AC_MSG_CHECKING([whether iops->put_link() passes cookie])
40		ZFS_LINUX_TEST_RESULT([put_link_cookie], [
41			AC_MSG_RESULT(yes)
42			AC_DEFINE(HAVE_PUT_LINK_COOKIE, 1,
43			    [iops->put_link() cookie])
44		],[
45			AC_MSG_RESULT(no)
46
47			dnl #
48			dnl # 2.6.32 API
49			dnl #
50			AC_MSG_CHECKING(
51			    [whether iops->put_link() passes nameidata])
52			ZFS_LINUX_TEST_RESULT([put_link_nameidata], [
53				AC_MSG_RESULT(yes)
54				AC_DEFINE(HAVE_PUT_LINK_NAMEIDATA, 1,
55				    [iops->put_link() nameidata])
56			],[
57				ZFS_LINUX_TEST_ERROR([put_link])
58			])
59		])
60	])
61])
62