1 AC_DEFUN([ZFS_AC_KERNEL_VFS_ITERATE], [
5 AC_MSG_CHECKING([whether fops->iterate_shared() is available])
6 ZFS_LINUX_TRY_COMPILE([
8 int iterate(struct file *filp, struct dir_context * context)
11 static const struct file_operations fops
12 __attribute__ ((unused)) = {
13 .iterate_shared = iterate,
18 AC_DEFINE(HAVE_VFS_ITERATE_SHARED, 1,
19 [fops->iterate_shared() is available])
26 dnl # RHEL 7.5 compatibility; the fops.iterate() method was
27 dnl # added to the file_operations structure but in order to
28 dnl # maintain KABI compatibility all callers must set
29 dnl # FMODE_KABI_ITERATE which is checked in iterate_dir().
30 dnl # When detected ignore this interface and fallback to
31 dnl # to using fops.readdir() to retain KABI compatibility.
33 AC_MSG_CHECKING([whether fops->iterate() is available])
34 ZFS_LINUX_TRY_COMPILE([
36 int iterate(struct file *filp,
37 struct dir_context *context) { return 0; }
39 static const struct file_operations fops
40 __attribute__ ((unused)) = {
44 #if defined(FMODE_KABI_ITERATE)
45 #error "RHEL 7.5, FMODE_KABI_ITERATE interface"
50 AC_DEFINE(HAVE_VFS_ITERATE, 1,
51 [fops->iterate() is available])
55 AC_MSG_CHECKING([whether fops->readdir() is available])
56 ZFS_LINUX_TRY_COMPILE([
58 int readdir(struct file *filp, void *entry,
59 filldir_t func) { return 0; }
61 static const struct file_operations fops
62 __attribute__ ((unused)) = {
68 AC_DEFINE(HAVE_VFS_READDIR, 1,
69 [fops->readdir() is available])
71 AC_MSG_ERROR(no; file a bug report with ZoL)