1 AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_ITERATE], [
2 ZFS_LINUX_TEST_SRC([file_operations_iterate_shared], [
4 int iterate(struct file *filp, struct dir_context * context)
7 static const struct file_operations fops
8 __attribute__ ((unused)) = {
9 .iterate_shared = iterate,
13 ZFS_LINUX_TEST_SRC([file_operations_iterate], [
15 int iterate(struct file *filp,
16 struct dir_context *context) { return 0; }
18 static const struct file_operations fops
19 __attribute__ ((unused)) = {
23 #if defined(FMODE_KABI_ITERATE)
24 #error "RHEL 7.5, FMODE_KABI_ITERATE interface"
28 ZFS_LINUX_TEST_SRC([file_operations_readdir], [
30 int readdir(struct file *filp, void *entry,
31 filldir_t func) { return 0; }
33 static const struct file_operations fops
34 __attribute__ ((unused)) = {
40 AC_DEFUN([ZFS_AC_KERNEL_VFS_ITERATE], [
44 AC_MSG_CHECKING([whether fops->iterate_shared() is available])
45 ZFS_LINUX_TEST_RESULT([file_operations_iterate_shared], [
47 AC_DEFINE(HAVE_VFS_ITERATE_SHARED, 1,
48 [fops->iterate_shared() is available])
55 dnl # RHEL 7.5 compatibility; the fops.iterate() method was
56 dnl # added to the file_operations structure but in order to
57 dnl # maintain KABI compatibility all callers must set
58 dnl # FMODE_KABI_ITERATE which is checked in iterate_dir().
59 dnl # When detected ignore this interface and fallback to
60 dnl # to using fops.readdir() to retain KABI compatibility.
62 AC_MSG_CHECKING([whether fops->iterate() is available])
63 ZFS_LINUX_TEST_RESULT([file_operations_iterate], [
65 AC_DEFINE(HAVE_VFS_ITERATE, 1,
66 [fops->iterate() is available])
71 dnl # readdir interface introduced
73 AC_MSG_CHECKING([whether fops->readdir() is available])
74 ZFS_LINUX_TEST_RESULT([file_operations_readdir], [
76 AC_DEFINE(HAVE_VFS_READDIR, 1,
77 [fops->readdir() is available])
79 ZFS_LINUX_TEST_ERROR([vfs_iterate])