Fix use-afer-free regression in RAIDZ expansion
[zfs.git] / config / kernel-symlink.m4
blobfb6d23f61cbfd44fa8607190cbfac32e5ed7edb7
1 AC_DEFUN([ZFS_AC_KERNEL_SRC_SYMLINK], [
2         dnl #
3         dnl # 6.3 API change that changed the first arg
4         dnl # to struct mnt_idmap*
5         dnl #
6         ZFS_LINUX_TEST_SRC([symlink_mnt_idmap], [
7                 #include <linux/fs.h>
8                 #include <linux/sched.h>
9                 static int tmp_symlink(struct mnt_idmap *idmap,
10                     struct inode *inode ,struct dentry *dentry,
11                     const char *path) { return 0; }
13                 static const struct inode_operations
14                         iops __attribute__ ((unused)) = {
15                         .symlink                = tmp_symlink,
16                 };
17         ],[])
18         dnl #
19         dnl # 5.12 API change that added the struct user_namespace* arg
20         dnl # to the front of this function type's arg list.
21         dnl #
22         ZFS_LINUX_TEST_SRC([symlink_userns], [
23                 #include <linux/fs.h>
24                 #include <linux/sched.h>
26                 static int tmp_symlink(struct user_namespace *userns,
27                     struct inode *inode ,struct dentry *dentry,
28                     const char *path) { return 0; }
30                 static const struct inode_operations
31                         iops __attribute__ ((unused)) = {
32                         .symlink                = tmp_symlink,
33                 };
34         ],[])
37 AC_DEFUN([ZFS_AC_KERNEL_SYMLINK], [
38         AC_MSG_CHECKING([whether iops->symlink() takes struct mnt_idmap*])
39         ZFS_LINUX_TEST_RESULT([symlink_mnt_idmap], [
40                 AC_MSG_RESULT(yes)
41                 AC_DEFINE(HAVE_IOPS_SYMLINK_IDMAP, 1,
42                     [iops->symlink() takes struct mnt_idmap*])
43         ],[
44                 AC_MSG_RESULT(no)
46                 AC_MSG_CHECKING([whether iops->symlink() takes struct user_namespace*])
47                 ZFS_LINUX_TEST_RESULT([symlink_userns], [
48                         AC_MSG_RESULT(yes)
49                         AC_DEFINE(HAVE_IOPS_SYMLINK_USERNS, 1,
50                             [iops->symlink() takes struct user_namespace*])
51                 ],[
52                         AC_MSG_RESULT(no)
53                 ])
54         ])