3 dnl # Add support for i_op->tmpfile
5 AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [
8 dnl # The first arg is now struct mnt_idmap *
10 ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_mnt_idmap], [
12 static int tmpfile(struct mnt_idmap *idmap,
13 struct inode *inode, struct file *file,
14 umode_t mode) { return 0; }
15 static struct inode_operations
16 iops __attribute__ ((unused)) = {
21 dnl # use struct file instead of struct dentry
23 ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [
25 static int tmpfile(struct user_namespace *userns,
26 struct inode *inode, struct file *file,
27 umode_t mode) { return 0; }
28 static struct inode_operations
29 iops __attribute__ ((unused)) = {
35 dnl # add support for userns parameter to tmpfile
37 ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_dentry_userns], [
39 static int tmpfile(struct user_namespace *userns,
40 struct inode *inode, struct dentry *dentry,
41 umode_t mode) { return 0; }
42 static struct inode_operations
43 iops __attribute__ ((unused)) = {
47 ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_dentry], [
49 static int tmpfile(struct inode *inode, struct dentry *dentry,
50 umode_t mode) { return 0; }
51 static struct inode_operations
52 iops __attribute__ ((unused)) = {
58 AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [
59 AC_MSG_CHECKING([whether i_op->tmpfile() exists])
60 ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_mnt_idmap], [
62 AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
63 AC_DEFINE(HAVE_TMPFILE_IDMAP, 1, [i_op->tmpfile() has mnt_idmap])
65 ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [
67 AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
68 AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
70 ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry_userns], [
72 AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
73 AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
74 AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature])
76 ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry], [
78 AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
79 AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature])
81 ZFS_LINUX_REQUIRE_API([i_op->tmpfile()], [3.11])