Clean up existing VERIFY*() macros.
[zfs.git] / config / kernel-inode-create.m4
blob95f8aa2d5220aa3173901ae6aa8cb5f37b236c3e
1 AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE], [
2         dnl #
3         dnl # 6.3 API change
4         dnl # The first arg is changed to struct mnt_idmap *
5         dnl #
6         ZFS_LINUX_TEST_SRC([create_mnt_idmap], [
7                 #include <linux/fs.h>
8                 #include <linux/sched.h>
10                 static int inode_create(struct mnt_idmap *idmap,
11                     struct inode *inode ,struct dentry *dentry,
12                     umode_t umode, bool flag) { return 0; }
14                 static const struct inode_operations
15                         iops __attribute__ ((unused)) = {
16                         .create         = inode_create,
17                 };
18         ],[])
20         dnl #
21         dnl # 5.12 API change that added the struct user_namespace* arg
22         dnl # to the front of this function type's arg list.
23         dnl #
24         ZFS_LINUX_TEST_SRC([create_userns], [
25                 #include <linux/fs.h>
26                 #include <linux/sched.h>
28                 static int inode_create(struct user_namespace *userns,
29                     struct inode *inode ,struct dentry *dentry,
30                     umode_t umode, bool flag) { return 0; }
32                 static const struct inode_operations
33                         iops __attribute__ ((unused)) = {
34                         .create         = inode_create,
35                 };
36         ],[])
38         dnl #
39         dnl # 3.6 API change
40         dnl #
41         ZFS_LINUX_TEST_SRC([create_flags], [
42                 #include <linux/fs.h>
43                 #include <linux/sched.h>
45                 static int inode_create(struct inode *inode ,struct dentry *dentry,
46                     umode_t umode, bool flag) { return 0; }
48                 static const struct inode_operations
49                     iops __attribute__ ((unused)) = {
50                         .create         = inode_create,
51                 };
52         ],[])
55 AC_DEFUN([ZFS_AC_KERNEL_CREATE], [
56         AC_MSG_CHECKING([whether iops->create() takes struct mnt_idmap*])
57         ZFS_LINUX_TEST_RESULT([create_mnt_idmap], [
58                 AC_MSG_RESULT(yes)
59                 AC_DEFINE(HAVE_IOPS_CREATE_IDMAP, 1,
60                    [iops->create() takes struct mnt_idmap*])
61         ],[
62                 AC_MSG_RESULT(no)
64                 AC_MSG_CHECKING([whether iops->create() takes struct user_namespace*])
65                 ZFS_LINUX_TEST_RESULT([create_userns], [
66                         AC_MSG_RESULT(yes)
67                         AC_DEFINE(HAVE_IOPS_CREATE_USERNS, 1,
68                            [iops->create() takes struct user_namespace*])
69                 ],[
70                         AC_MSG_RESULT(no)
72                         AC_MSG_CHECKING([whether iops->create() passes flags])
73                         ZFS_LINUX_TEST_RESULT([create_flags], [
74                                 AC_MSG_RESULT(yes)
75                         ],[
76                                 ZFS_LINUX_TEST_ERROR([iops->create()])
77                         ])
78                 ])
79         ])