]> git.proxmox.com Git - mirror_zfs-debian.git/blame - config/kernel-vfs-iterate.m4
Imported Upstream version 0.6.5.8
[mirror_zfs-debian.git] / config / kernel-vfs-iterate.m4
CommitLineData
c06d4368 1AC_DEFUN([ZFS_AC_KERNEL_VFS_ITERATE], [
87dac73d
AX
2 dnl #
3 dnl # 4.7 API change
4 dnl #
5 AC_MSG_CHECKING([whether fops->iterate_shared() is available])
c06d4368
AX
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)) = {
87dac73d 13 .iterate_shared = iterate,
c06d4368
AX
14 };
15 ],[
16 ],[
17 AC_MSG_RESULT(yes)
87dac73d
AX
18 AC_DEFINE(HAVE_VFS_ITERATE_SHARED, 1,
19 [fops->iterate_shared() is available])
c06d4368
AX
20 ],[
21 AC_MSG_RESULT(no)
22
87dac73d
AX
23 dnl #
24 dnl # 3.11 API change
25 dnl #
26 AC_MSG_CHECKING([whether fops->iterate() is available])
c06d4368
AX
27 ZFS_LINUX_TRY_COMPILE([
28 #include <linux/fs.h>
87dac73d 29 int iterate(struct file *filp, struct dir_context * context)
c06d4368
AX
30 { return 0; }
31
32 static const struct file_operations fops
33 __attribute__ ((unused)) = {
87dac73d 34 .iterate = iterate,
c06d4368
AX
35 };
36 ],[
37 ],[
38 AC_MSG_RESULT(yes)
87dac73d
AX
39 AC_DEFINE(HAVE_VFS_ITERATE, 1,
40 [fops->iterate() is available])
c06d4368 41 ],[
87dac73d
AX
42 AC_MSG_RESULT(no)
43
44 AC_MSG_CHECKING([whether fops->readdir() is available])
45 ZFS_LINUX_TRY_COMPILE([
46 #include <linux/fs.h>
47 int readdir(struct file *filp, void *entry, filldir_t func)
48 { return 0; }
c06d4368 49
87dac73d
AX
50 static const struct file_operations fops
51 __attribute__ ((unused)) = {
52 .readdir = readdir,
53 };
54 ],[
55 ],[
56 AC_MSG_RESULT(yes)
57 AC_DEFINE(HAVE_VFS_READDIR, 1,
58 [fops->readdir() is available])
59 ],[
60 AC_MSG_ERROR(no; file a bug report with ZFSOnLinux)
61 ])
62 ])
c06d4368
AX
63 ])
64])