]>
Commit | Line | Data |
---|---|---|
787acae0 GDN |
1 | dnl # |
2 | dnl # Linux 4.14 API, | |
3 | dnl # | |
26a85659 | 4 | dnl # The bio_set_dev() helper macro was introduced as part of the transition |
787acae0 GDN |
5 | dnl # to have struct gendisk in struct bio. |
6 | dnl # | |
26a85659 | 7 | AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV_MACRO], [ |
787acae0 GDN |
8 | AC_MSG_CHECKING([whether bio_set_dev() exists]) |
9 | ZFS_LINUX_TRY_COMPILE([ | |
10 | #include <linux/bio.h> | |
11 | #include <linux/fs.h> | |
12 | ],[ | |
13 | struct block_device *bdev = NULL; | |
14 | struct bio *bio = NULL; | |
15 | bio_set_dev(bio, bdev); | |
16 | ],[ | |
17 | AC_MSG_RESULT(yes) | |
18 | AC_DEFINE(HAVE_BIO_SET_DEV, 1, [bio_set_dev() exists]) | |
19 | ],[ | |
20 | AC_MSG_RESULT(no) | |
21 | ]) | |
22 | ]) | |
26a85659 BB |
23 | |
24 | dnl # | |
25 | dnl # Linux 5.0 API, | |
26 | dnl # | |
27 | dnl # The bio_set_dev() helper macro was updated to internally depend on | |
28 | dnl # bio_associate_blkg() symbol which is exported GPL-only. | |
29 | dnl # | |
30 | AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV_GPL_ONLY], [ | |
31 | AC_MSG_CHECKING([whether bio_set_dev() is GPL-only]) | |
32 | ZFS_LINUX_TRY_COMPILE([ | |
33 | #include <linux/module.h> | |
34 | #include <linux/bio.h> | |
35 | #include <linux/fs.h> | |
36 | MODULE_LICENSE("$ZFS_META_LICENSE"); | |
37 | ],[ | |
38 | struct block_device *bdev = NULL; | |
39 | struct bio *bio = NULL; | |
40 | bio_set_dev(bio, bdev); | |
41 | ],[ | |
42 | AC_MSG_RESULT(no) | |
43 | ],[ | |
44 | AC_MSG_RESULT(yes) | |
45 | AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1, | |
46 | [bio_set_dev() GPL-only]) | |
47 | ]) | |
48 | ]) | |
49 | ||
50 | AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [ | |
51 | ZFS_AC_KERNEL_BIO_SET_DEV_MACRO | |
52 | ZFS_AC_KERNEL_BIO_SET_DEV_GPL_ONLY | |
53 | ]) |