xref: /freebsd/sys/contrib/openzfs/config/kernel-fs-parse.m4 (revision d9497217456002b0ddad3cd319570d0b098daa29)
1dnl # SPDX-License-Identifier: CDDL-1.0
2dnl #
3dnl # 5.6 API change
4dnl # Before 5.6, fs_parse() took a struct fs_parameter_description
5dnl # which wraps the parameter specs with name and enum pointers. From 5.6,
6dnl # the description struct was removed and fs_parse() accepts the
7dnl # fs_parameter_spec directly.
8dnl #
9AC_DEFUN([ZFS_AC_KERNEL_SRC_FS_PARSE], [
10	ZFS_LINUX_TEST_SRC([fs_parse], [
11		#include <linux/fs_context.h>
12		#include <linux/fs_parser.h>
13	],[
14		static const struct fs_parameter_spec specs[] = {
15			{}
16		};
17		int test __attribute__ ((unused));
18		struct fs_context *fc __attribute__ ((unused)) = NULL;
19		struct fs_parameter param __attribute__ ((unused));
20		struct fs_parse_result result __attribute__ ((unused));
21		test = fs_parse(fc, specs, &param, &result);
22	])
23])
24
25AC_DEFUN([ZFS_AC_KERNEL_FS_PARSE], [
26	AC_MSG_CHECKING([whether fs_parse() takes fs_parameter_spec directly])
27	ZFS_LINUX_TEST_RESULT([fs_parse], [
28		AC_MSG_RESULT(yes)
29		AC_DEFINE(HAVE_FS_PARSE_TAKES_SPEC, 1,
30		    [fs_parse() takes fs_parameter_spec directly])
31	],[
32		AC_MSG_RESULT(no)
33	])
34])
35