2 dnl # 2.6.38 API change
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
5 ZFS_LINUX_TEST_SRC([block_device_operations_check_events], [
6 #include <linux/blkdev.h>
8 static unsigned int blk_check_events(struct gendisk *disk,
9 unsigned int clearing) {
10 (void) disk, (void) clearing;
14 static const struct block_device_operations
15 bops __attribute__ ((unused)) = {
16 .check_events = blk_check_events,
21 AC_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], [
26 ZFS_LINUX_TEST_ERROR([bops->check_events()])
31 dnl # 3.10.x API change
33 AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
34 ZFS_LINUX_TEST_SRC([block_device_operations_release_void], [
35 #include <linux/blkdev.h>
37 static void blk_release(struct gendisk *g, fmode_t mode) {
38 (void) g, (void) mode;
42 static const struct block_device_operations
43 bops __attribute__ ((unused)) = {
45 .release = blk_release,
53 dnl # 5.9.x API change
55 AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG], [
56 ZFS_LINUX_TEST_SRC([block_device_operations_release_void_1arg], [
57 #include <linux/blkdev.h>
59 static void blk_release(struct gendisk *g) {
64 static const struct block_device_operations
65 bops __attribute__ ((unused)) = {
67 .release = blk_release,
74 AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
75 AC_MSG_CHECKING([whether bops->release() is void and takes 2 args])
76 ZFS_LINUX_TEST_RESULT([block_device_operations_release_void], [
80 AC_MSG_CHECKING([whether bops->release() is void and takes 1 arg])
81 ZFS_LINUX_TEST_RESULT([block_device_operations_release_void_1arg], [
83 AC_DEFINE([HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG], [1],
84 [Define if release() in block_device_operations takes 1 arg])
86 ZFS_LINUX_TEST_ERROR([bops->release()])
93 dnl # block_device_operations->revalidate_disk() was removed
95 AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
96 ZFS_LINUX_TEST_SRC([block_device_operations_revalidate_disk], [
97 #include <linux/blkdev.h>
99 static int blk_revalidate_disk(struct gendisk *disk) {
104 static const struct block_device_operations
105 bops __attribute__ ((unused)) = {
106 .revalidate_disk = blk_revalidate_disk,
111 AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [
112 AC_MSG_CHECKING([whether bops->revalidate_disk() exists])
113 ZFS_LINUX_TEST_RESULT([block_device_operations_revalidate_disk], [
114 AC_DEFINE([HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK], [1],
115 [Define if revalidate_disk() in block_device_operations])
122 AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS], [
123 ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
124 ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
125 ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG
126 ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK
129 AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS], [
130 ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
131 ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
132 ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK