2 dnl # 2.6.29 API change
3 dnl # In the 2.6.29 kernel blk_rq_bytes() was available as a GPL-only symbol.
4 dnl # So we need to check the symbol license as well. As of 2.6.31 the
5 dnl blk_rq_bytes() helper was changed to a static inline which we can use.
7 AC_DEFUN([ZFS_AC_KERNEL_BLK_RQ_BYTES], [
8 AC_MSG_CHECKING([whether blk_rq_bytes() is available])
9 tmp_flags="$EXTRA_KCFLAGS"
10 EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
11 ZFS_LINUX_TRY_COMPILE([
12 #include <linux/blkdev.h>
14 struct request *req = NULL;
15 (void) blk_rq_bytes(req);
18 AC_DEFINE(HAVE_BLK_RQ_BYTES, 1,
19 [blk_rq_bytes() is available])
24 AC_MSG_CHECKING([whether blk_rq_bytes() is GPL-only])
25 ZFS_LINUX_TRY_COMPILE([
26 #include <linux/module.h>
27 #include <linux/blkdev.h>
29 MODULE_LICENSE("CDDL");
31 struct request *req = NULL;
32 (void) blk_rq_bytes(req);
37 AC_DEFINE(HAVE_BLK_RQ_BYTES_GPL_ONLY, 1,
38 [blk_rq_bytes() is GPL-only])
40 EXTRA_KCFLAGS="$tmp_flags"