xref: /freebsd/sys/contrib/openzfs/config/kernel-automount.m4 (revision ee3960cba1068e12fb032a68c46d74841d9edab3)
1dnl #
2dnl # 2.6.37 API change
3dnl # The dops->d_automount() dentry operation was added as a clean
4dnl # solution to handling automounts.  Prior to this cifs/nfs clients
5dnl # which required automount support would abuse the follow_link()
6dnl # operation on directories for this purpose.
7dnl #
8AC_DEFUN([ZFS_AC_KERNEL_SRC_D_AUTOMOUNT], [
9	ZFS_LINUX_TEST_SRC([dentry_operations_d_automount], [
10		#include <linux/dcache.h>
11		static struct vfsmount *d_automount(struct path *p) { return NULL; }
12		struct dentry_operations dops __attribute__ ((unused)) = {
13			.d_automount = d_automount,
14		};
15	])
16])
17
18AC_DEFUN([ZFS_AC_KERNEL_D_AUTOMOUNT], [
19	AC_MSG_CHECKING([whether dops->d_automount() exists])
20	ZFS_LINUX_TEST_RESULT([dentry_operations_d_automount], [
21		AC_MSG_RESULT(yes)
22	],[
23		ZFS_LINUX_TEST_ERROR([dops->d_automount()])
24	])
25])
26
27dnl #
28dnl # 6.14 API change
29dnl # dops->d_revalidate now has four args.
30dnl #
31AC_DEFUN([ZFS_AC_KERNEL_SRC_D_REVALIDATE_4ARGS], [
32	ZFS_LINUX_TEST_SRC([dentry_operations_d_revalidate_4args], [
33		#include <linux/dcache.h>
34		static int d_revalidate(struct inode *dir,
35		    const struct qstr *name, struct dentry *dentry,
36		    unsigned int fl) { return 0; }
37		struct dentry_operations dops __attribute__ ((unused)) = {
38			.d_revalidate = d_revalidate,
39		};
40	])
41])
42
43AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_4ARGS], [
44	AC_MSG_CHECKING([whether dops->d_revalidate() takes 4 args])
45	ZFS_LINUX_TEST_RESULT([dentry_operations_d_revalidate_4args], [
46		AC_MSG_RESULT(yes)
47		AC_DEFINE(HAVE_D_REVALIDATE_4ARGS, 1,
48		    [dops->d_revalidate() takes 4 args])
49	],[
50		AC_MSG_RESULT(no)
51	])
52])
53
54AC_DEFUN([ZFS_AC_KERNEL_SRC_AUTOMOUNT], [
55	ZFS_AC_KERNEL_SRC_D_AUTOMOUNT
56	ZFS_AC_KERNEL_SRC_D_REVALIDATE_4ARGS
57])
58
59AC_DEFUN([ZFS_AC_KERNEL_AUTOMOUNT], [
60	ZFS_AC_KERNEL_D_AUTOMOUNT
61	ZFS_AC_KERNEL_D_REVALIDATE_4ARGS
62])
63