Add -p switch to "zpool get"
[zfs.git] / config / kernel-blk-queue-flush.m4
1 dnl #
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.
11 dnl #
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>
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 ])