2019-10-01 22:50:34 +03:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
|
2023-04-11 00:15:36 +03:00
|
|
|
dnl #
|
|
|
|
dnl # Linux 6.3 API
|
|
|
|
dnl # The first arg of getattr I/O operations handler type
|
|
|
|
dnl # is changed to struct mnt_idmap*
|
|
|
|
dnl #
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_getattr_mnt_idmap], [
|
|
|
|
#include <linux/fs.h>
|
|
|
|
|
2024-01-23 02:50:53 +03:00
|
|
|
static int test_getattr(
|
2023-04-11 00:15:36 +03:00
|
|
|
struct mnt_idmap *idmap,
|
|
|
|
const struct path *p, struct kstat *k,
|
|
|
|
u32 request_mask, unsigned int query_flags)
|
|
|
|
{ return 0; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.getattr = test_getattr,
|
|
|
|
};
|
|
|
|
],[])
|
|
|
|
|
2021-03-20 07:00:59 +03:00
|
|
|
dnl #
|
|
|
|
dnl # Linux 5.12 API
|
|
|
|
dnl # The getattr I/O operations handler type was extended to require
|
|
|
|
dnl # a struct user_namespace* as its first arg, to support idmapped
|
|
|
|
dnl # mounts.
|
|
|
|
dnl #
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_getattr_userns], [
|
|
|
|
#include <linux/fs.h>
|
|
|
|
|
2024-01-23 02:50:53 +03:00
|
|
|
static int test_getattr(
|
2021-03-20 07:00:59 +03:00
|
|
|
struct user_namespace *userns,
|
|
|
|
const struct path *p, struct kstat *k,
|
|
|
|
u32 request_mask, unsigned int query_flags)
|
|
|
|
{ return 0; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.getattr = test_getattr,
|
|
|
|
};
|
|
|
|
],[])
|
|
|
|
|
|
|
|
dnl #
|
|
|
|
dnl # Linux 4.11 API
|
|
|
|
dnl # See torvalds/linux@a528d35
|
|
|
|
dnl #
|
2019-10-01 22:50:34 +03:00
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_getattr_path], [
|
2017-03-21 03:51:16 +03:00
|
|
|
#include <linux/fs.h>
|
|
|
|
|
2024-01-23 02:50:53 +03:00
|
|
|
static int test_getattr(
|
2017-03-21 03:51:16 +03:00
|
|
|
const struct path *p, struct kstat *k,
|
|
|
|
u32 request_mask, unsigned int query_flags)
|
|
|
|
{ return 0; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.getattr = test_getattr,
|
|
|
|
};
|
2019-10-01 22:50:34 +03:00
|
|
|
],[])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
|
2021-03-20 07:00:59 +03:00
|
|
|
dnl #
|
2023-04-11 00:15:36 +03:00
|
|
|
dnl # Kernel 6.3 test
|
2021-03-20 07:00:59 +03:00
|
|
|
dnl #
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_MSG_CHECKING([whether iops->getattr() takes mnt_idmap])
|
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_mnt_idmap], [
|
2017-03-21 03:51:16 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_DEFINE(HAVE_IDMAP_IOPS_GETATTR, 1,
|
|
|
|
[iops->getattr() takes struct mnt_idmap*])
|
2017-03-21 03:51:16 +03:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
2021-03-20 07:00:59 +03:00
|
|
|
dnl #
|
2023-04-11 00:15:36 +03:00
|
|
|
dnl # Kernel 5.12 test
|
2021-03-20 07:00:59 +03:00
|
|
|
dnl #
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_MSG_CHECKING([whether iops->getattr() takes user_namespace])
|
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_userns], [
|
2019-10-01 22:50:34 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_DEFINE(HAVE_USERNS_IOPS_GETATTR, 1,
|
|
|
|
[iops->getattr() takes struct user_namespace*])
|
2019-10-01 22:50:34 +03:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
2021-03-20 07:00:59 +03:00
|
|
|
|
|
|
|
dnl #
|
2023-04-11 00:15:36 +03:00
|
|
|
dnl # Kernel 4.11 test
|
2021-03-20 07:00:59 +03:00
|
|
|
dnl #
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_MSG_CHECKING([whether iops->getattr() takes a path])
|
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_path], [
|
2021-03-20 07:00:59 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
|
|
|
|
[iops->getattr() takes a path])
|
2021-03-20 07:00:59 +03:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
2019-10-01 22:50:34 +03:00
|
|
|
])
|
|
|
|
])
|
2017-03-21 03:51:16 +03:00
|
|
|
])
|