]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-block-device-operations.m4
Allow platform dependent path stripping for vdevs
[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,
9 unsigned int clearing) { return (0); }
10
11 static const struct block_device_operations
12 bops __attribute__ ((unused)) = {
13 .check_events = blk_check_events,
14 };
608f8749
BB
15 ], [], [$NO_UNUSED_BUT_SET_VARIABLE])
16])
17
18AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [
19 AC_MSG_CHECKING([whether bops->check_events() exists])
20 ZFS_LINUX_TEST_RESULT([block_device_operations_check_events], [
7b98f0d9
BB
21 AC_MSG_RESULT(yes)
22 AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS, 1,
23 [bops->check_events() exists])
24 ],[
25 AC_MSG_RESULT(no)
26 ])
7b98f0d9
BB
27])
28
29dnl #
30dnl # 3.10.x API change
31dnl #
608f8749
BB
32AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
33 ZFS_LINUX_TEST_SRC([block_device_operations_release_void], [
7b98f0d9
BB
34 #include <linux/blkdev.h>
35
36 void blk_release(struct gendisk *g, fmode_t mode) { return; }
37
38 static const struct block_device_operations
39 bops __attribute__ ((unused)) = {
40 .open = NULL,
41 .release = blk_release,
42 .ioctl = NULL,
43 .compat_ioctl = NULL,
44 };
608f8749
BB
45 ], [], [$NO_UNUSED_BUT_SET_VARIABLE])
46])
47
48AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
49 AC_MSG_CHECKING([whether bops->release() is void])
50 ZFS_LINUX_TEST_RESULT([block_device_operations_release_void], [
51 AC_MSG_RESULT(yes)
7b98f0d9
BB
52 AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID, 1,
53 [bops->release() returns void])
54 ],[
608f8749 55 AC_MSG_RESULT(no)
7b98f0d9 56 ])
608f8749
BB
57])
58
59AC_DEFUN([ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS], [
60 ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
61 ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
62])
63
64AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS], [
65 ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS
66 ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
7b98f0d9 67])