]> git.proxmox.com Git - mirror_zfs-debian.git/blame - config/kernel-blk-queue-flush.m4
Move partition scanning from userspace to module.
[mirror_zfs-debian.git] / config / kernel-blk-queue-flush.m4
CommitLineData
b18019d2
ED
1dnl #
2dnl # 2.6.36 API change
3dnl # In 2.6.36 kernels the blk_queue_ordered() interface has been
4dnl # replaced by the simpler blk_queue_flush(). However, while the
5dnl # old interface was available to all the new one is GPL-only.
6dnl # Thus in addition to detecting if this function is available
7dnl # we determine if it is GPL-only. If the GPL-only interface is
8dnl # there we implement our own compatibility function, otherwise
9dnl # we use the function. The hope is that long term this function
10dnl # will be opened up.
11dnl #
12AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
13 AC_MSG_CHECKING([whether blk_queue_flush() is available])
14 tmp_flags="$EXTRA_KCFLAGS"
15 EXTRA_KCFLAGS="-Wno-unused-but-set-variable"
16 ZFS_LINUX_TRY_COMPILE([
17 #include <linux/blkdev.h>
18 ],[
19 struct request_queue *q = NULL;
20 (void) blk_queue_flush(q, REQ_FLUSH);
21 ],[
22 AC_MSG_RESULT(yes)
23 AC_DEFINE(HAVE_BLK_QUEUE_FLUSH, 1,
24 [blk_queue_flush() is available])
25 ],[
26 AC_MSG_RESULT(no)
27 ])
28
29 AC_MSG_CHECKING([whether blk_queue_flush() is GPL-only])
30 ZFS_LINUX_TRY_COMPILE([
31 #include <linux/module.h>
32 #include <linux/blkdev.h>
33
34 MODULE_LICENSE("CDDL");
35 ],[
36 struct request_queue *q = NULL;
37 (void) blk_queue_flush(q, REQ_FLUSH);
38 ],[
39 AC_MSG_RESULT(no)
40 ],[
41 AC_MSG_RESULT(yes)
42 AC_DEFINE(HAVE_BLK_QUEUE_FLUSH_GPL_ONLY, 1,
43 [blk_queue_flush() is GPL-only])
44 ])
45 EXTRA_KCFLAGS="$tmp_flags"
46])