2 dnl # 2.6.36 API change
3 dnl # In 2.6.36 kernels the blk_queue_ordered() interface has been
4 dnl # replaced by the simpler blk_queue_flush(). However, while the
5 dnl # old interface was available to all the new one is GPL-only.
6 dnl # Thus in addition to detecting if this function is available
7 dnl # we determine if it is GPL-only. If the GPL-only interface is
8 dnl # there we implement our own compatibility function, otherwise
9 dnl # we use the function. The hope is that long term this function
10 dnl # will be opened up.
12 AC_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="${NO_UNUSED_BUT_SET_VARIABLE}"
16 ZFS_LINUX_TRY_COMPILE([
17 #include <linux/blkdev.h>
19 struct request_queue *q = NULL;
20 (void) blk_queue_flush(q, REQ_FLUSH);
23 AC_DEFINE(HAVE_BLK_QUEUE_FLUSH, 1,
24 [blk_queue_flush() is available])
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>
34 MODULE_LICENSE("$ZFS_META_LICENSE");
36 struct request_queue *q = NULL;
37 (void) blk_queue_flush(q, REQ_FLUSH);
42 AC_DEFINE(HAVE_BLK_QUEUE_FLUSH_GPL_ONLY, 1,
43 [blk_queue_flush() is GPL-only])
45 EXTRA_KCFLAGS="$tmp_flags"