xref: /freebsd/sys/contrib/openzfs/config/kernel-inode-create.m4 (revision f9bc005b8ef3b507a5ecbc2d7fe4411ef70eff38)
1dnl # SPDX-License-Identifier: CDDL-1.0
2dnl #
3dnl # 7.3 API change.
4dnl #
5dnl # inode_operations->create drops flag arg. We test for the mnt_idmap
6dnl # version without the flag arg, to avoid have to test for all the
7dnl # idmap/userns variants back to before 5.12 (see kernel-idmap.m4).
8dnl #
9AC_DEFUN([ZFS_AC_KERNEL_SRC_IOPS_CREATE_NO_FLAG], [
10	ZFS_LINUX_TEST_SRC([iops_create_no_flag], [
11		#include <linux/fs.h>
12
13		static int test_iops_create(struct mnt_idmap *idmap,
14		    struct inode *inode, struct dentry *dentry,
15		    umode_t mode) { return 0; }
16
17		static const struct inode_operations test_iops
18		    __attribute__ ((unused)) = {
19			.create = test_iops_create
20		};
21	],[])
22])
23
24AC_DEFUN([ZFS_AC_KERNEL_IOPS_CREATE_NO_FLAG], [
25	AC_MSG_CHECKING([whether iops->create() takes a flag arg])
26	ZFS_LINUX_TEST_RESULT([iops_create_no_flag], [
27		AC_MSG_RESULT(no)
28		AC_DEFINE(HAVE_IOPS_CREATE_NO_FLAG_ARG, 1,
29		    [iops->create() does not take a flag arg])
30	],[
31		AC_MSG_RESULT(yes)
32	])
33])
34
35