]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-block-device-operations.m4
Revert "Reduce dbuf_find() lock contention"
[mirror_zfs.git] / config / kernel-block-device-operations.m4
CommitLineData
7b98f0d9
BB
1dnl #
2dnl # 2.6.38 API change
3dnl #
608f8749
BB
4AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
5 ZFS_LINUX_TEST_SRC([block_device_operations_check_events], [
7b98f0d9
BB
6 #include <linux/blkdev.h>
7
8 unsigned int blk_check_events(struct gendisk *disk,
72154bd6
AZ
9 unsigned int clearing) {
10 (void) disk, (void) clearing;
11 return (0);
12 }
7b98f0d9
BB
13
14 static const struct block_device_operations
15 bops __attribute__ ((unused)) = {
16 .check_events = blk_check_events,
17 };
72154bd6 18 ], [], [])
608f8749
BB
19])
20
21AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
22 AC_MSG_CHECKING([whether bops->check_events() exists])
23 ZFS_LINUX_TEST_RESULT([block_device_operations_check_events], [
7b98f0d9 24 AC_MSG_RESULT(yes)
7b98f0d9 25 ],[
066e8252 26 ZFS_LINUX_TEST_ERROR([bops->check_events()])
7b98f0d9 27 ])
7b98f0d9
BB
28])
29
30dnl #
31dnl # 3.10.x API change
32dnl #
608f8749
BB
33AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
34 ZFS_LINUX_TEST_SRC([block_device_operations_release_void], [
7b98f0d9
BB
35 #include <linux/blkdev.h>
36
72154bd6
AZ
37 void blk_release(struct gendisk *g, fmode_t mode) {
38 (void) g, (void) mode;
39 return;
40 }
7b98f0d9
BB
41
42 static const struct block_device_operations
43 bops __attribute__ ((unused)) = {
44 .open = NULL,
45 .release = blk_release,
46 .ioctl = NULL,
47 .compat_ioctl = NULL,
48 };
72154bd6 49 ], [], [])
608f8749
BB
50])
51
52AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
53 AC_MSG_CHECKING([whether bops->release() is void])
54 ZFS_LINUX_TEST_RESULT([block_device_operations_release_void], [
55 AC_MSG_RESULT(yes)
7b98f0d9 56 ],[
066e8252 57 ZFS_LINUX_TEST_ERROR([bops->release()])
7b98f0d9 58 ])
608f8749
BB
59])
60
48c7b0e4
CK
61dnl #
62dnl # 5.13 API change
63dnl # block_device_operations->revalidate_disk() was removed
64dnl #
65AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
66 ZFS_LINUX_TEST_SRC([block_device_operations_revalidate_disk], [
67 #include <linux/blkdev.h>
68
69 int blk_revalidate_disk(struct gendisk *disk) {
72154bd6 70 (void) disk;
48c7b0e4
CK
71 return(0);
72 }
73
74 static const struct block_device_operations
75 bops __attribute__ ((unused)) = {
76 .revalidate_disk = blk_revalidate_disk,
77 };
72154bd6 78 ], [], [])
48c7b0e4
CK
79])
80
81AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
82 AC_MSG_CHECKING([whether bops->revalidate_disk() exists])
83 ZFS_LINUX_TEST_RESULT([block_device_operations_revalidate_disk], [
84 AC_DEFINE([HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [1],
85 [Define if revalidate_disk() in block_device_operations])
86 AC_MSG_RESULT(yes)
87 ],[
88 AC_MSG_RESULT(no)
89 ])
90])
91
608f8749
BB
92AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS], [
93 ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
94 ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
48c7b0e4 95 ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK
608f8749
BB
96])
97
98AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS], [
99 ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
100 ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
48c7b0e4 101 ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK
7b98f0d9 102])