]>
Commit | Line | Data |
---|---|---|
e2a82961 | 1 | AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE], [ |
d4dc53da YY |
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> | |
9 | ||
a41d0b29 | 10 | static int inode_create(struct mnt_idmap *idmap, |
d4dc53da YY |
11 | struct inode *inode ,struct dentry *dentry, |
12 | umode_t umode, bool flag) { return 0; } | |
13 | ||
14 | static const struct inode_operations | |
15 | iops __attribute__ ((unused)) = { | |
16 | .create = inode_create, | |
17 | }; | |
18 | ],[]) | |
19 | ||
e2a82961 CK |
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> | |
27 | ||
a41d0b29 | 28 | static int inode_create(struct user_namespace *userns, |
e2a82961 CK |
29 | struct inode *inode ,struct dentry *dentry, |
30 | umode_t umode, bool flag) { return 0; } | |
31 | ||
32 | static const struct inode_operations | |
33 | iops __attribute__ ((unused)) = { | |
34 | .create = inode_create, | |
35 | }; | |
36 | ],[]) | |
37 | ||
38 | dnl # | |
39 | dnl # 3.6 API change | |
40 | dnl # | |
066e8252 BB |
41 | ZFS_LINUX_TEST_SRC([create_flags], [ |
42 | #include <linux/fs.h> | |
43 | #include <linux/sched.h> | |
44 | ||
a41d0b29 | 45 | static int inode_create(struct inode *inode ,struct dentry *dentry, |
066e8252 BB |
46 | umode_t umode, bool flag) { return 0; } |
47 | ||
48 | static const struct inode_operations | |
49 | iops __attribute__ ((unused)) = { | |
50 | .create = inode_create, | |
51 | }; | |
52 | ],[]) | |
53 | ]) | |
54 | ||
e2a82961 | 55 | AC_DEFUN([ZFS_AC_KERNEL_CREATE], [ |
d4dc53da YY |
56 | AC_MSG_CHECKING([whether iops->create() takes struct mnt_idmap*]) |
57 | ZFS_LINUX_TEST_RESULT([create_mnt_idmap], [ | |
066e8252 | 58 | AC_MSG_RESULT(yes) |
d4dc53da YY |
59 | AC_DEFINE(HAVE_IOPS_CREATE_IDMAP, 1, |
60 | [iops->create() takes struct mnt_idmap*]) | |
066e8252 | 61 | ],[ |
e2a82961 CK |
62 | AC_MSG_RESULT(no) |
63 | ||
d4dc53da YY |
64 | AC_MSG_CHECKING([whether iops->create() takes struct user_namespace*]) |
65 | ZFS_LINUX_TEST_RESULT([create_userns], [ | |
e2a82961 | 66 | AC_MSG_RESULT(yes) |
d4dc53da YY |
67 | AC_DEFINE(HAVE_IOPS_CREATE_USERNS, 1, |
68 | [iops->create() takes struct user_namespace*]) | |
e2a82961 | 69 | ],[ |
d4dc53da YY |
70 | AC_MSG_RESULT(no) |
71 | ||
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 | ]) | |
e2a82961 | 78 | ]) |
066e8252 BB |
79 | ]) |
80 | ]) |