]>
Commit | Line | Data |
---|---|---|
ace1eae8 CC |
1 | dnl # |
2 | dnl # 3.11 API change | |
3 | dnl # Add support for i_op->tmpfile | |
4 | dnl # | |
608f8749 | 5 | AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [ |
d27c8184 | 6 | dnl # |
d4dc53da YY |
7 | dnl # 6.3 API change |
8 | dnl # The first arg is now struct mnt_idmap * | |
9 | dnl # | |
10 | ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_mnt_idmap], [ | |
11 | #include <linux/fs.h> | |
a41d0b29 | 12 | static int tmpfile(struct mnt_idmap *idmap, |
d4dc53da YY |
13 | struct inode *inode, struct file *file, |
14 | umode_t mode) { return 0; } | |
15 | static struct inode_operations | |
16 | iops __attribute__ ((unused)) = { | |
17 | .tmpfile = tmpfile, | |
18 | }; | |
19 | ],[]) | |
d27c8184 AR |
20 | dnl # 6.1 API change |
21 | dnl # use struct file instead of struct dentry | |
22 | dnl # | |
23 | ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [ | |
24 | #include <linux/fs.h> | |
a41d0b29 | 25 | static int tmpfile(struct user_namespace *userns, |
d27c8184 AR |
26 | struct inode *inode, struct file *file, |
27 | umode_t mode) { return 0; } | |
28 | static struct inode_operations | |
29 | iops __attribute__ ((unused)) = { | |
30 | .tmpfile = tmpfile, | |
31 | }; | |
32 | ],[]) | |
0b1b66b4 RE |
33 | dnl # |
34 | dnl # 5.11 API change | |
35 | dnl # add support for userns parameter to tmpfile | |
36 | dnl # | |
d27c8184 | 37 | ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_dentry_userns], [ |
ace1eae8 | 38 | #include <linux/fs.h> |
a41d0b29 | 39 | static int tmpfile(struct user_namespace *userns, |
0b1b66b4 | 40 | struct inode *inode, struct dentry *dentry, |
ace1eae8 CC |
41 | umode_t mode) { return 0; } |
42 | static struct inode_operations | |
43 | iops __attribute__ ((unused)) = { | |
44 | .tmpfile = tmpfile, | |
45 | }; | |
608f8749 | 46 | ],[]) |
d27c8184 | 47 | ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_dentry], [ |
0b1b66b4 | 48 | #include <linux/fs.h> |
a41d0b29 | 49 | static int tmpfile(struct inode *inode, struct dentry *dentry, |
0b1b66b4 RE |
50 | umode_t mode) { return 0; } |
51 | static struct inode_operations | |
52 | iops __attribute__ ((unused)) = { | |
53 | .tmpfile = tmpfile, | |
54 | }; | |
55 | ],[]) | |
608f8749 BB |
56 | ]) |
57 | ||
58 | AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [ | |
59 | AC_MSG_CHECKING([whether i_op->tmpfile() exists]) | |
d4dc53da | 60 | ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_mnt_idmap], [ |
ace1eae8 | 61 | AC_MSG_RESULT(yes) |
608f8749 | 62 | AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists]) |
d4dc53da YY |
63 | AC_DEFINE(HAVE_TMPFILE_IDMAP, 1, [i_op->tmpfile() has mnt_idmap]) |
64 | ], [ | |
65 | ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [ | |
0b1b66b4 RE |
66 | AC_MSG_RESULT(yes) |
67 | AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists]) | |
d27c8184 | 68 | AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns]) |
0b1b66b4 | 69 | ],[ |
d4dc53da | 70 | ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry_userns], [ |
d27c8184 AR |
71 | AC_MSG_RESULT(yes) |
72 | AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists]) | |
d4dc53da | 73 | AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns]) |
d27c8184 AR |
74 | AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature]) |
75 | ],[ | |
d4dc53da YY |
76 | ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry], [ |
77 | AC_MSG_RESULT(yes) | |
78 | AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists]) | |
79 | AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature]) | |
80 | ],[ | |
81 | ZFS_LINUX_REQUIRE_API([i_op->tmpfile()], [3.11]) | |
82 | ]) | |
d27c8184 | 83 | ]) |
0b1b66b4 | 84 | ]) |
ace1eae8 CC |
85 | ]) |
86 | ]) |