]> git.proxmox.com Git - mirror_zfs-debian.git/blob - config/kernel-bdev-block-device-operations.m4
Add build system
[mirror_zfs-debian.git] / config / kernel-bdev-block-device-operations.m4
1 dnl #
2 dnl # 2.6.x API change
3 dnl #
4 AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [
5 AC_MSG_CHECKING([block device operation prototypes])
6 ZFS_LINUX_TRY_COMPILE([
7 #include <linux/blkdev.h>
8 ],[
9 int (*blk_open) (struct block_device *, fmode_t) = NULL;
10 int (*blk_release) (struct gendisk *, fmode_t) = NULL;
11 int (*blk_ioctl) (struct block_device *, fmode_t,
12 unsigned, unsigned long) = NULL;
13 int (*blk_compat_ioctl) (struct block_device *, fmode_t,
14 unsigned, unsigned long) = NULL;
15 struct block_device_operations blk_ops = {
16 .open = blk_open,
17 .release = blk_release,
18 .ioctl = blk_ioctl,
19 .compat_ioctl = blk_compat_ioctl,
20 };
21
22 blk_ops.open(NULL, 0);
23 blk_ops.release(NULL, 0);
24 blk_ops.ioctl(NULL, 0, 0, 0);
25 blk_ops.compat_ioctl(NULL, 0, 0, 0);
26 ],[
27 AC_MSG_RESULT(struct block_device)
28 AC_DEFINE(HAVE_BDEV_BLOCK_DEVICE_OPERATIONS, 1,
29 [struct block_device_operations use bdevs])
30 ],[
31 AC_MSG_RESULT(struct inode)
32 ])
33 ])