]>
Commit | Line | Data |
---|---|---|
c9c0d073 BB |
1 | dnl # |
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. | |
6 | dnl # | |
7 | AC_DEFUN([ZFS_AC_KERNEL_BLK_RQ_BYTES], [ | |
8 | AC_MSG_CHECKING([whether blk_rq_bytes() is available]) | |
b9c59ec8 | 9 | tmp_flags="$EXTRA_KCFLAGS" |
e191b54e | 10 | EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}" |
c9c0d073 BB |
11 | ZFS_LINUX_TRY_COMPILE([ |
12 | #include <linux/blkdev.h> | |
13 | ],[ | |
14 | struct request *req = NULL; | |
15 | (void) blk_rq_bytes(req); | |
16 | ],[ | |
17 | AC_MSG_RESULT(yes) | |
18 | AC_DEFINE(HAVE_BLK_RQ_BYTES, 1, | |
19 | [blk_rq_bytes() is available]) | |
20 | ],[ | |
21 | AC_MSG_RESULT(no) | |
22 | ]) | |
23 | ||
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> | |
28 | ||
29 | MODULE_LICENSE("CDDL"); | |
30 | ],[ | |
31 | struct request *req = NULL; | |
32 | (void) blk_rq_bytes(req); | |
33 | ],[ | |
34 | AC_MSG_RESULT(no) | |
35 | ],[ | |
36 | AC_MSG_RESULT(yes) | |
37 | AC_DEFINE(HAVE_BLK_RQ_BYTES_GPL_ONLY, 1, | |
38 | [blk_rq_bytes() is GPL-only]) | |
39 | ]) | |
b9c59ec8 | 40 | EXTRA_KCFLAGS="$tmp_flags" |
c9c0d073 | 41 | ]) |