3.10 API change: block_device_operations->release() returns void
[zfs.git] / config / kernel-block-device-operations-release-void.m4
1 dnl #
2 dnl # 3.10.x API change
3 dnl #
4 AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
5         AC_MSG_CHECKING([whether block_device_operations.release is void])
6         tmp_flags="$EXTRA_KCFLAGS"
7         EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
8         ZFS_LINUX_TRY_COMPILE([
9                 #include <linux/blkdev.h>
10
11                 void blk_release(struct gendisk *g, fmode_t mode) { return; }
12
13                 static const struct block_device_operations
14                     bops __attribute__ ((unused)) = {
15                         .open           = NULL,
16                         .release        = blk_release,
17                         .ioctl          = NULL,
18                         .compat_ioctl   = NULL,
19                 };
20         ],[
21         ],[
22                 AC_MSG_RESULT(void)
23                 AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID, 1,
24                           [struct block_device_operations.release returns void])
25         ],[
26                 AC_MSG_RESULT(int)
27         ])
28         EXTRA_KCFLAGS="$tmp_flags"
29 ])