]>
Commit | Line | Data |
---|---|---|
608f8749 BB |
1 | AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_ITERATE], [ |
2 | ZFS_LINUX_TEST_SRC([file_operations_iterate_shared], [ | |
0f37d0c8 RY |
3 | #include <linux/fs.h> |
4 | int iterate(struct file *filp, struct dir_context * context) | |
5 | { return 0; } | |
6 | ||
7 | static const struct file_operations fops | |
8 | __attribute__ ((unused)) = { | |
9baaa7de | 9 | .iterate_shared = iterate, |
0f37d0c8 | 10 | }; |
608f8749 BB |
11 | ],[]) |
12 | ||
13 | ZFS_LINUX_TEST_SRC([file_operations_iterate], [ | |
14 | #include <linux/fs.h> | |
15 | int iterate(struct file *filp, | |
16 | struct dir_context *context) { return 0; } | |
17 | ||
18 | static const struct file_operations fops | |
19 | __attribute__ ((unused)) = { | |
20 | .iterate = iterate, | |
21 | }; | |
22 | ||
23 | #if defined(FMODE_KABI_ITERATE) | |
24 | #error "RHEL 7.5, FMODE_KABI_ITERATE interface" | |
25 | #endif | |
26 | ],[]) | |
27 | ||
28 | ZFS_LINUX_TEST_SRC([file_operations_readdir], [ | |
29 | #include <linux/fs.h> | |
30 | int readdir(struct file *filp, void *entry, | |
31 | filldir_t func) { return 0; } | |
32 | ||
33 | static const struct file_operations fops | |
34 | __attribute__ ((unused)) = { | |
35 | .readdir = readdir, | |
36 | }; | |
37 | ],[]) | |
38 | ]) | |
39 | ||
40 | AC_DEFUN([ZFS_AC_KERNEL_VFS_ITERATE], [ | |
41 | dnl # | |
42 | dnl # 4.7 API change | |
43 | dnl # | |
44 | AC_MSG_CHECKING([whether fops->iterate_shared() is available]) | |
45 | ZFS_LINUX_TEST_RESULT([file_operations_iterate_shared], [ | |
0f37d0c8 | 46 | AC_MSG_RESULT(yes) |
9baaa7de | 47 | AC_DEFINE(HAVE_VFS_ITERATE_SHARED, 1, |
608f8749 | 48 | [fops->iterate_shared() is available]) |
0f37d0c8 RY |
49 | ],[ |
50 | AC_MSG_RESULT(no) | |
51 | ||
9baaa7de CC |
52 | dnl # |
53 | dnl # 3.11 API change | |
54 | dnl # | |
9464b959 BB |
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. | |
61 | dnl # | |
9baaa7de | 62 | AC_MSG_CHECKING([whether fops->iterate() is available]) |
608f8749 | 63 | ZFS_LINUX_TEST_RESULT([file_operations_iterate], [ |
0f37d0c8 | 64 | AC_MSG_RESULT(yes) |
9baaa7de | 65 | AC_DEFINE(HAVE_VFS_ITERATE, 1, |
608f8749 | 66 | [fops->iterate() is available]) |
0f37d0c8 | 67 | ],[ |
9baaa7de CC |
68 | AC_MSG_RESULT(no) |
69 | ||
608f8749 BB |
70 | dnl # |
71 | dnl # readdir interface introduced | |
72 | dnl # | |
9baaa7de | 73 | AC_MSG_CHECKING([whether fops->readdir() is available]) |
608f8749 | 74 | ZFS_LINUX_TEST_RESULT([file_operations_readdir], [ |
9baaa7de CC |
75 | AC_MSG_RESULT(yes) |
76 | AC_DEFINE(HAVE_VFS_READDIR, 1, | |
608f8749 | 77 | [fops->readdir() is available]) |
9baaa7de | 78 | ],[ |
608f8749 | 79 | ZFS_LINUX_TEST_ERROR([vfs_iterate]) |
9baaa7de CC |
80 | ]) |
81 | ]) | |
0f37d0c8 RY |
82 | ]) |
83 | ]) |