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_IDMAP, 1, [i_op->tmpfile() has mnt_idmap])
64 ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [
66 AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
68 ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry_userns], [
70 AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
71 AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature])
73 ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry], [
75 AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature])
77 ZFS_LINUX_REQUIRE_API([i_op->tmpfile()], [3.11])