2013-10-28 20:22:15 +04:00
|
|
|
dnl #
|
|
|
|
dnl # 3.1 API change,
|
2019-11-12 19:59:06 +03:00
|
|
|
dnl # posix_acl_equiv_mode now wants an umode_t instead of a mode_t
|
2013-10-28 20:22:15 +04:00
|
|
|
dnl #
|
2019-10-01 22:50:34 +03:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
|
|
|
|
ZFS_LINUX_TEST_SRC([posix_acl_equiv_mode], [
|
2013-10-28 20:22:15 +04:00
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/posix_acl.h>
|
|
|
|
],[
|
|
|
|
umode_t tmp;
|
2019-11-12 19:59:06 +03:00
|
|
|
posix_acl_equiv_mode(NULL, &tmp);
|
2019-10-01 22:50:34 +03:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
|
|
|
|
AC_MSG_CHECKING([whether posix_acl_equiv_mode() wants umode_t])
|
|
|
|
ZFS_LINUX_TEST_RESULT([posix_acl_equiv_mode], [
|
2013-10-28 20:22:15 +04:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
],[
|
2019-11-12 19:59:06 +03:00
|
|
|
ZFS_LINUX_TEST_ERROR([posix_acl_equiv_mode()])
|
2013-10-28 20:22:15 +04:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl #
|
|
|
|
dnl # 3.1 API change,
|
|
|
|
dnl # Check if inode_operations contains the function get_acl
|
|
|
|
dnl #
|
2021-09-09 19:38:35 +03:00
|
|
|
dnl # 5.15 API change,
|
|
|
|
dnl # Added the bool rcu argument to get_acl for rcu path walk.
|
|
|
|
dnl #
|
2023-01-24 22:20:50 +03:00
|
|
|
dnl # 6.2 API change,
|
|
|
|
dnl # get_acl() was renamed to get_inode_acl()
|
|
|
|
dnl #
|
2019-10-01 22:50:34 +03:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL], [
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_get_acl], [
|
2013-10-28 20:22:15 +04:00
|
|
|
#include <linux/fs.h>
|
|
|
|
|
2024-01-23 02:50:53 +03:00
|
|
|
static struct posix_acl *get_acl_fn(struct inode *inode, int type)
|
2013-10-28 20:22:15 +04:00
|
|
|
{ return NULL; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.get_acl = get_acl_fn,
|
|
|
|
};
|
2019-10-01 22:50:34 +03:00
|
|
|
],[])
|
2021-09-09 19:38:35 +03:00
|
|
|
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_get_acl_rcu], [
|
|
|
|
#include <linux/fs.h>
|
|
|
|
|
2024-01-23 02:50:53 +03:00
|
|
|
static struct posix_acl *get_acl_fn(struct inode *inode, int type,
|
2021-09-09 19:38:35 +03:00
|
|
|
bool rcu) { return NULL; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.get_acl = get_acl_fn,
|
|
|
|
};
|
|
|
|
],[])
|
2022-12-27 06:04:34 +03:00
|
|
|
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_get_inode_acl], [
|
|
|
|
#include <linux/fs.h>
|
|
|
|
|
2024-01-23 02:50:53 +03:00
|
|
|
static struct posix_acl *get_inode_acl_fn(struct inode *inode, int type,
|
2022-12-27 06:04:34 +03:00
|
|
|
bool rcu) { return NULL; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.get_inode_acl = get_inode_acl_fn,
|
|
|
|
};
|
|
|
|
],[])
|
2019-10-01 22:50:34 +03:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
|
|
|
AC_MSG_CHECKING([whether iops->get_acl() exists])
|
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_get_acl], [
|
2013-10-28 20:22:15 +04:00
|
|
|
AC_MSG_RESULT(yes)
|
2021-09-09 19:38:35 +03:00
|
|
|
AC_DEFINE(HAVE_GET_ACL, 1, [iops->get_acl() exists])
|
2013-10-28 20:22:15 +04:00
|
|
|
],[
|
2021-09-09 19:38:35 +03:00
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_get_acl_rcu], [
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_GET_ACL_RCU, 1, [iops->get_acl() takes rcu])
|
|
|
|
],[
|
2022-12-27 06:04:34 +03:00
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_get_inode_acl], [
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_GET_INODE_ACL, 1, [has iops->get_inode_acl()])
|
|
|
|
],[
|
|
|
|
ZFS_LINUX_TEST_ERROR([iops->get_acl() or iops->get_inode_acl()])
|
|
|
|
])
|
2021-09-09 19:38:35 +03:00
|
|
|
])
|
2013-10-28 20:22:15 +04:00
|
|
|
])
|
|
|
|
])
|
2016-08-09 03:26:21 +03:00
|
|
|
|
2016-11-09 21:37:17 +03:00
|
|
|
dnl #
|
2021-05-27 18:55:49 +03:00
|
|
|
dnl # 5.12 API change,
|
|
|
|
dnl # set_acl() added a user_namespace* parameter first
|
|
|
|
dnl #
|
2023-01-24 22:20:50 +03:00
|
|
|
dnl # 6.2 API change,
|
|
|
|
dnl # set_acl() second paramter changed to a struct dentry *
|
|
|
|
dnl #
|
2023-04-11 00:15:36 +03:00
|
|
|
dnl # 6.3 API change,
|
|
|
|
dnl # set_acl() first parameter changed to struct mnt_idmap *
|
|
|
|
dnl #
|
2019-10-01 22:50:34 +03:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
|
2023-04-11 00:15:36 +03:00
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_mnt_idmap_dentry], [
|
|
|
|
#include <linux/fs.h>
|
|
|
|
|
2024-01-23 02:50:53 +03:00
|
|
|
static int set_acl_fn(struct mnt_idmap *idmap,
|
2023-04-11 00:15:36 +03:00
|
|
|
struct dentry *dent, struct posix_acl *acl,
|
|
|
|
int type) { return 0; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.set_acl = set_acl_fn,
|
|
|
|
};
|
|
|
|
],[])
|
2023-01-24 22:20:50 +03:00
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns_dentry], [
|
|
|
|
#include <linux/fs.h>
|
|
|
|
|
2024-01-23 02:50:53 +03:00
|
|
|
static int set_acl_fn(struct user_namespace *userns,
|
2023-01-24 22:20:50 +03:00
|
|
|
struct dentry *dent, struct posix_acl *acl,
|
|
|
|
int type) { return 0; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.set_acl = set_acl_fn,
|
|
|
|
};
|
|
|
|
],[])
|
2021-05-27 18:55:49 +03:00
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns], [
|
|
|
|
#include <linux/fs.h>
|
|
|
|
|
2024-01-23 02:50:53 +03:00
|
|
|
static int set_acl_fn(struct user_namespace *userns,
|
2021-05-27 18:55:49 +03:00
|
|
|
struct inode *inode, struct posix_acl *acl,
|
|
|
|
int type) { return 0; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.set_acl = set_acl_fn,
|
|
|
|
};
|
|
|
|
],[])
|
2019-10-01 22:50:34 +03:00
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_set_acl], [
|
2016-11-09 21:37:17 +03:00
|
|
|
#include <linux/fs.h>
|
|
|
|
|
2024-01-23 02:50:53 +03:00
|
|
|
static int set_acl_fn(struct inode *inode, struct posix_acl *acl,
|
2019-10-01 22:50:34 +03:00
|
|
|
int type) { return 0; }
|
2016-11-09 21:37:17 +03:00
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.set_acl = set_acl_fn,
|
|
|
|
};
|
2019-10-01 22:50:34 +03:00
|
|
|
],[])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
|
2024-08-04 02:47:34 +03:00
|
|
|
AC_MSG_CHECKING([whether iops->set_acl() with 4 args exists])
|
2021-05-27 18:55:49 +03:00
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns], [
|
2016-11-09 21:37:17 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2021-05-27 18:55:49 +03:00
|
|
|
AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args])
|
2016-11-09 21:37:17 +03:00
|
|
|
],[
|
2023-04-11 00:15:36 +03:00
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_mnt_idmap_dentry], [
|
2021-05-27 18:55:49 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_DEFINE(HAVE_SET_ACL_IDMAP_DENTRY, 1,
|
|
|
|
[iops->set_acl() takes 4 args, arg1 is struct mnt_idmap *])
|
2021-05-27 18:55:49 +03:00
|
|
|
],[
|
2023-04-11 00:15:36 +03:00
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns_dentry], [
|
2023-01-24 22:20:50 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_DEFINE(HAVE_SET_ACL_USERNS_DENTRY_ARG2, 1,
|
|
|
|
[iops->set_acl() takes 4 args, arg2 is struct dentry *])
|
2023-01-24 22:20:50 +03:00
|
|
|
],[
|
2024-08-04 02:47:34 +03:00
|
|
|
AC_MSG_RESULT(no)
|
2023-01-24 22:20:50 +03:00
|
|
|
])
|
2021-05-27 18:55:49 +03:00
|
|
|
])
|
2016-11-09 21:37:17 +03:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2019-10-01 22:50:34 +03:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [
|
|
|
|
ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
|
|
|
|
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL
|
|
|
|
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_ACL], [
|
|
|
|
ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
|
|
|
|
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
|
|
|
|
ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL
|
|
|
|
])
|