mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Linux 5.0 compat: Fix bio_set_dev()
The Linux 5.0 kernel updated the bio_set_dev() macro so it calls the GPL-only bio_associate_blkg() symbol thus inadvertently converting the entire macro. Provide a minimal version which always assigns the request queue's root_blkg to the bio. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #8287
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
dnl #
|
||||
dnl # Linux 4.14 API,
|
||||
dnl #
|
||||
dnl # The bio_set_dev() helper was introduced as part of the transition
|
||||
dnl # The bio_set_dev() helper macro was introduced as part of the transition
|
||||
dnl # to have struct gendisk in struct bio.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV_MACRO], [
|
||||
AC_MSG_CHECKING([whether bio_set_dev() exists])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/bio.h>
|
||||
@@ -20,3 +20,34 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 5.0 API,
|
||||
dnl #
|
||||
dnl # The bio_set_dev() helper macro was updated to internally depend on
|
||||
dnl # bio_associate_blkg() symbol which is exported GPL-only.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV_GPL_ONLY], [
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is GPL-only])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/module.h>
|
||||
#include <linux/bio.h>
|
||||
#include <linux/fs.h>
|
||||
MODULE_LICENSE("$ZFS_META_LICENSE");
|
||||
],[
|
||||
struct block_device *bdev = NULL;
|
||||
struct bio *bio = NULL;
|
||||
bio_set_dev(bio, bdev);
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1,
|
||||
[bio_set_dev() GPL-only])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
||||
ZFS_AC_KERNEL_BIO_SET_DEV_MACRO
|
||||
ZFS_AC_KERNEL_BIO_SET_DEV_GPL_ONLY
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user