mirror_zfs/config/kernel-fs-context.m4
Rob Norris f3d4c79496
zpl_super: prefer "new" mount API when available
This API has been available since kernel 5.2, and having it available
(almost) everywhere should give us a lot more flexibility for mount
management in the future.

Sponsored-by: TrueNAS
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@truenas.com>
Closes #18260
2026-02-25 13:17:33 -08:00

34 lines
1.0 KiB
Plaintext

dnl # SPDX-License-Identifier: CDDL-1.0
dnl #
dnl # 2.6.38 API change
dnl # The .get_sb callback has been replaced by a .mount callback
dnl # in the file_system_type structure.
dnl #
dnl # 5.2 API change
dnl # The new fs_context-based filesystem API is introduced, with the old
dnl # one (via file_system_type.mount) preserved as a compatibility shim.
dnl #
dnl # 7.0 API change
dnl # Compatibility shim removed, so all callers must go through the mount API.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_FS_CONTEXT], [
ZFS_LINUX_TEST_SRC([fs_context], [
#include <linux/fs.h>
#include <linux/fs_context.h>
],[
static struct fs_context fs __attribute__ ((unused)) = { 0 };
static struct fs_context *fsp __attribute__ ((unused));
fsp = vfs_dup_fs_context(&fs);
])
])
AC_DEFUN([ZFS_AC_KERNEL_FS_CONTEXT], [
AC_MSG_CHECKING([whether fs_context exists])
ZFS_LINUX_TEST_RESULT([fs_context], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_FS_CONTEXT, 1, [fs_context exists])
],[
AC_MSG_RESULT(no)
])
])