]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - config/kernel-bio_set_dev.m4
Allow platform dependent path stripping for vdevs
[FreeBSD/FreeBSD.git] / config / kernel-bio_set_dev.m4
1 dnl #
2 dnl # Linux 4.14 API,
3 dnl #
4 dnl # The bio_set_dev() helper macro was introduced as part of the transition
5 dnl # to have struct gendisk in struct bio. 
6 dnl #
7 dnl # Linux 5.0 API,
8 dnl #
9 dnl # The bio_set_dev() helper macro was updated to internally depend on
10 dnl # bio_associate_blkg() symbol which is exported GPL-only.
11 dnl #
12 AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV], [
13         ZFS_LINUX_TEST_SRC([bio_set_dev], [
14                 #include <linux/bio.h>
15                 #include <linux/fs.h>
16         ],[
17                 struct block_device *bdev = NULL;
18                 struct bio *bio = NULL;
19                 bio_set_dev(bio, bdev);
20         ], [], [$ZFS_META_LICENSE])
21 ])
22
23 AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
24         AC_MSG_CHECKING([whether bio_set_dev() is available])
25         ZFS_LINUX_TEST_RESULT([bio_set_dev], [
26                 AC_MSG_RESULT(yes)
27                 AC_DEFINE(HAVE_BIO_SET_DEV, 1, [bio_set_dev() is available])
28
29                 AC_MSG_CHECKING([whether bio_set_dev() is GPL-only])
30                 ZFS_LINUX_TEST_RESULT([bio_set_dev_license], [
31                         AC_MSG_RESULT(no)
32                 ],[
33                         AC_MSG_RESULT(yes)
34                         AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1,
35                             [bio_set_dev() GPL-only])
36                 ])
37         ],[
38                 AC_MSG_RESULT(no)
39         ])
40 ])