2021-03-20 07:00:59 +03:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_RENAME], [
|
2019-06-22 03:35:11 +03:00
|
|
|
dnl #
|
|
|
|
dnl # 3.9 (to 4.9) API change,
|
|
|
|
dnl #
|
|
|
|
dnl # A new version of iops->rename() was added (rename2) that takes a flag
|
|
|
|
dnl # argument (to support renameat2). However this separate function was
|
|
|
|
dnl # merged back into iops->rename() in Linux 4.9.
|
|
|
|
dnl #
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_rename2], [
|
|
|
|
#include <linux/fs.h>
|
2024-01-23 02:50:53 +03:00
|
|
|
static int rename2_fn(struct inode *sip, struct dentry *sdp,
|
2019-06-22 03:35:11 +03:00
|
|
|
struct inode *tip, struct dentry *tdp,
|
|
|
|
unsigned int flags) { return 0; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.rename2 = rename2_fn,
|
|
|
|
};
|
|
|
|
],[])
|
|
|
|
|
2021-03-20 07:00:59 +03:00
|
|
|
dnl #
|
|
|
|
dnl # 4.9 API change,
|
2019-06-22 03:35:11 +03:00
|
|
|
dnl #
|
|
|
|
dnl # iops->rename2() merged into iops->rename(), and iops->rename() now
|
|
|
|
dnl # wants flags.
|
2021-03-20 07:00:59 +03:00
|
|
|
dnl #
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_rename_flags], [
|
2016-10-19 21:19:01 +03:00
|
|
|
#include <linux/fs.h>
|
2024-01-23 02:50:53 +03:00
|
|
|
static int rename_fn(struct inode *sip, struct dentry *sdp,
|
2016-10-19 21:19:01 +03:00
|
|
|
struct inode *tip, struct dentry *tdp,
|
|
|
|
unsigned int flags) { return 0; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.rename = rename_fn,
|
|
|
|
};
|
2019-10-01 22:50:34 +03:00
|
|
|
],[])
|
2021-03-20 07:00:59 +03:00
|
|
|
|
|
|
|
dnl #
|
|
|
|
dnl # 5.12 API change,
|
|
|
|
dnl #
|
2019-06-22 03:35:11 +03:00
|
|
|
dnl # Linux 5.12 introduced passing struct user_namespace* as the first
|
|
|
|
dnl # argument of the rename() and other inode_operations members.
|
2021-03-20 07:00:59 +03:00
|
|
|
dnl #
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_rename_userns], [
|
|
|
|
#include <linux/fs.h>
|
2024-01-23 02:50:53 +03:00
|
|
|
static int rename_fn(struct user_namespace *user_ns, struct inode *sip,
|
2021-03-20 07:00:59 +03:00
|
|
|
struct dentry *sdp, struct inode *tip, struct dentry *tdp,
|
|
|
|
unsigned int flags) { return 0; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.rename = rename_fn,
|
|
|
|
};
|
|
|
|
],[])
|
2023-04-11 00:15:36 +03:00
|
|
|
|
|
|
|
dnl #
|
|
|
|
dnl # 6.3 API change - the first arg is now struct mnt_idmap*
|
|
|
|
dnl #
|
|
|
|
ZFS_LINUX_TEST_SRC([inode_operations_rename_mnt_idmap], [
|
|
|
|
#include <linux/fs.h>
|
2024-01-23 02:50:53 +03:00
|
|
|
static int rename_fn(struct mnt_idmap *idmap, struct inode *sip,
|
2023-04-11 00:15:36 +03:00
|
|
|
struct dentry *sdp, struct inode *tip, struct dentry *tdp,
|
|
|
|
unsigned int flags) { return 0; }
|
|
|
|
|
|
|
|
static const struct inode_operations
|
|
|
|
iops __attribute__ ((unused)) = {
|
|
|
|
.rename = rename_fn,
|
|
|
|
};
|
|
|
|
],[])
|
2019-10-01 22:50:34 +03:00
|
|
|
])
|
|
|
|
|
2021-03-20 07:00:59 +03:00
|
|
|
AC_DEFUN([ZFS_AC_KERNEL_RENAME], [
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_MSG_CHECKING([whether iops->rename() takes struct mnt_idmap*])
|
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_rename_mnt_idmap], [
|
2016-10-19 21:19:01 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_DEFINE(HAVE_IOPS_RENAME_IDMAP, 1,
|
|
|
|
[iops->rename() takes struct mnt_idmap*])
|
2016-10-19 21:19:01 +03:00
|
|
|
],[
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_MSG_CHECKING([whether iops->rename() takes struct user_namespace*])
|
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_rename_userns], [
|
2021-03-20 07:00:59 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_DEFINE(HAVE_IOPS_RENAME_USERNS, 1,
|
|
|
|
[iops->rename() takes struct user_namespace*])
|
2021-03-20 07:00:59 +03:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
2019-06-22 03:35:11 +03:00
|
|
|
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_MSG_CHECKING([whether iops->rename2() exists])
|
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_rename2], [
|
2019-06-22 03:35:11 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_DEFINE(HAVE_RENAME2, 1, [iops->rename2() exists])
|
2019-06-22 03:35:11 +03:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_MSG_CHECKING([whether iops->rename() wants flags])
|
|
|
|
ZFS_LINUX_TEST_RESULT([inode_operations_rename_flags], [
|
2019-06-22 03:35:11 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2023-04-11 00:15:36 +03:00
|
|
|
AC_DEFINE(HAVE_RENAME_WANTS_FLAGS, 1,
|
|
|
|
[iops->rename() wants flags])
|
2019-06-22 03:35:11 +03:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
|
|
|
])
|
2021-03-20 07:00:59 +03:00
|
|
|
])
|
2016-10-19 21:19:01 +03:00
|
|
|
])
|
|
|
|
])
|