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
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2016-08-02 21:11:45 +03:00
|
|
|
dnl #
|
|
|
|
dnl # 4.8 API change,
|
|
|
|
dnl # The function posix_acl_valid now must be passed a namespace.
|
|
|
|
dnl #
|
2019-10-01 22:50:34 +03:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS], [
|
|
|
|
ZFS_LINUX_TEST_SRC([posix_acl_valid_with_ns], [
|
2016-08-02 21:11:45 +03:00
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/posix_acl.h>
|
|
|
|
],[
|
|
|
|
struct user_namespace *user_ns = NULL;
|
|
|
|
const struct posix_acl *acl = NULL;
|
|
|
|
int error;
|
|
|
|
|
|
|
|
error = posix_acl_valid(user_ns, acl);
|
2019-10-01 22:50:34 +03:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS], [
|
|
|
|
AC_MSG_CHECKING([whether posix_acl_valid() wants user namespace])
|
|
|
|
ZFS_LINUX_TEST_RESULT([posix_acl_valid_with_ns], [
|
2016-08-02 21:11:45 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_POSIX_ACL_VALID_WITH_NS, 1,
|
|
|
|
[posix_acl_valid() wants user namespace])
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
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
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2016-08-09 03:26:21 +03:00
|
|
|
dnl #
|
|
|
|
dnl # 4.7 API change,
|
|
|
|
dnl # The kernel get_acl will now check cache before calling i_op->get_acl and
|
|
|
|
dnl # do set_cached_acl after that, so i_op->get_acl don't need to do that
|
|
|
|
dnl # anymore.
|
|
|
|
dnl #
|
2019-10-01 22:50:34 +03:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE], [
|
|
|
|
ZFS_LINUX_TEST_SRC([get_acl_handle_cache], [
|
|
|
|
#include <linux/fs.h>
|
|
|
|
],[
|
|
|
|
void *sentinel __attribute__ ((unused)) =
|
|
|
|
uncached_acl_sentinel(NULL);
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2016-11-02 03:19:52 +03:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE], [
|
2016-08-09 03:26:21 +03:00
|
|
|
AC_MSG_CHECKING([whether uncached_acl_sentinel() exists])
|
2019-10-01 22:50:34 +03:00
|
|
|
ZFS_LINUX_TEST_RESULT([get_acl_handle_cache], [
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_KERNEL_GET_ACL_HANDLE_CACHE, 1,
|
|
|
|
[uncached_acl_sentinel() exists])
|
2016-08-09 03:26:21 +03:00
|
|
|
],[
|
2019-10-01 22:50:34 +03:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl #
|
|
|
|
dnl # 4.16 kernel: check if struct posix_acl acl.a_refcount is a refcount_t.
|
|
|
|
dnl # It's an atomic_t on older kernels.
|
|
|
|
dnl #
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT], [
|
|
|
|
ZFS_LINUX_TEST_SRC([acl_refcount], [
|
|
|
|
#include <linux/backing-dev.h>
|
|
|
|
#include <linux/refcount.h>
|
|
|
|
#include <linux/posix_acl.h>
|
2016-08-09 03:26:21 +03:00
|
|
|
],[
|
2019-10-01 22:50:34 +03:00
|
|
|
struct posix_acl acl;
|
|
|
|
refcount_t *r __attribute__ ((unused)) = &acl.a_refcount;
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_ACL_HAS_REFCOUNT], [
|
|
|
|
AC_MSG_CHECKING([whether posix_acl has refcount_t])
|
|
|
|
ZFS_LINUX_TEST_RESULT([acl_refcount], [
|
2016-08-09 03:26:21 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2019-10-01 22:50:34 +03:00
|
|
|
AC_DEFINE(HAVE_ACL_REFCOUNT, 1, [posix_acl has refcount_t])
|
2016-08-09 03:26:21 +03:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
|
|
|
])
|
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_POSIX_ACL_VALID_WITH_NS
|
|
|
|
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL
|
|
|
|
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL
|
|
|
|
ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE
|
|
|
|
ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_ACL], [
|
|
|
|
ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
|
|
|
|
ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS
|
|
|
|
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
|
|
|
|
ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL
|
|
|
|
ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE
|
|
|
|
ZFS_AC_KERNEL_ACL_HAS_REFCOUNT
|
|
|
|
])
|