]>
Commit | Line | Data |
---|---|---|
0f37d0c8 | 1 | AC_DEFUN([ZFS_AC_KERNEL_VFS_ITERATE], [ |
9baaa7de CC |
2 | dnl # |
3 | dnl # 4.7 API change | |
4 | dnl # | |
5 | AC_MSG_CHECKING([whether fops->iterate_shared() is available]) | |
0f37d0c8 RY |
6 | ZFS_LINUX_TRY_COMPILE([ |
7 | #include <linux/fs.h> | |
8 | int iterate(struct file *filp, struct dir_context * context) | |
9 | { return 0; } | |
10 | ||
11 | static const struct file_operations fops | |
12 | __attribute__ ((unused)) = { | |
9baaa7de | 13 | .iterate_shared = iterate, |
0f37d0c8 RY |
14 | }; |
15 | ],[ | |
16 | ],[ | |
17 | AC_MSG_RESULT(yes) | |
9baaa7de CC |
18 | AC_DEFINE(HAVE_VFS_ITERATE_SHARED, 1, |
19 | [fops->iterate_shared() is available]) | |
0f37d0c8 RY |
20 | ],[ |
21 | AC_MSG_RESULT(no) | |
22 | ||
9baaa7de CC |
23 | dnl # |
24 | dnl # 3.11 API change | |
25 | dnl # | |
9464b959 BB |
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. | |
32 | dnl # | |
9baaa7de | 33 | AC_MSG_CHECKING([whether fops->iterate() is available]) |
0f37d0c8 RY |
34 | ZFS_LINUX_TRY_COMPILE([ |
35 | #include <linux/fs.h> | |
9464b959 BB |
36 | int iterate(struct file *filp, |
37 | struct dir_context *context) { return 0; } | |
0f37d0c8 RY |
38 | |
39 | static const struct file_operations fops | |
40 | __attribute__ ((unused)) = { | |
9baaa7de | 41 | .iterate = iterate, |
0f37d0c8 | 42 | }; |
9464b959 BB |
43 | |
44 | #if defined(FMODE_KABI_ITERATE) | |
45 | #error "RHEL 7.5, FMODE_KABI_ITERATE interface" | |
46 | #endif | |
0f37d0c8 RY |
47 | ],[ |
48 | ],[ | |
49 | AC_MSG_RESULT(yes) | |
9baaa7de CC |
50 | AC_DEFINE(HAVE_VFS_ITERATE, 1, |
51 | [fops->iterate() is available]) | |
0f37d0c8 | 52 | ],[ |
9baaa7de CC |
53 | AC_MSG_RESULT(no) |
54 | ||
55 | AC_MSG_CHECKING([whether fops->readdir() is available]) | |
56 | ZFS_LINUX_TRY_COMPILE([ | |
57 | #include <linux/fs.h> | |
9464b959 BB |
58 | int readdir(struct file *filp, void *entry, |
59 | filldir_t func) { return 0; } | |
0f37d0c8 | 60 | |
9baaa7de CC |
61 | static const struct file_operations fops |
62 | __attribute__ ((unused)) = { | |
63 | .readdir = readdir, | |
64 | }; | |
65 | ],[ | |
66 | ],[ | |
67 | AC_MSG_RESULT(yes) | |
68 | AC_DEFINE(HAVE_VFS_READDIR, 1, | |
69 | [fops->readdir() is available]) | |
70 | ],[ | |
9464b959 | 71 | AC_MSG_ERROR(no; file a bug report with ZoL) |
9baaa7de CC |
72 | ]) |
73 | ]) | |
0f37d0c8 RY |
74 | ]) |
75 | ]) |