diff options
author | Coleman Kane <[email protected]> | 2021-12-03 21:45:28 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-12-07 12:28:00 -0800 |
commit | d08b99aca04d7fa16b0c40170a219c21343ee658 (patch) | |
tree | 3f606936432a49ce33595388499dfa211038b598 /config/kernel-bio.m4 | |
parent | f6e22561d21af6700a1180ecaedc93049614b307 (diff) |
Linux 5.16: bio_set_dev is no longer a helper macro
This change adds a confiugre check to determine if bio_set_dev is a
helper macro or not. If not, then the attempt to override its internal
call to bio_associate_blkg(), with a macro definition to our own
version, is no longer possible, as the compiler won't use it when
compiling the new inline function replacement implemented in the header.
This change also creates a new vdev_bio_set_dev() function that performs
the same work, and also performs the work implemented in
vdev_bio_associate_blkg(), as it is the only thing calling that function
in our code. Our custom vdev_bio_associate_blkg() is now only compiled
if the bio_set_dev() is a macro in the Linux headers.
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes #12819
Diffstat (limited to 'config/kernel-bio.m4')
-rw-r--r-- | config/kernel-bio.m4 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/config/kernel-bio.m4 b/config/kernel-bio.m4 index 1d715b2de..df5e9de3b 100644 --- a/config/kernel-bio.m4 +++ b/config/kernel-bio.m4 @@ -191,6 +191,24 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV], [ ], [], [ZFS_META_LICENSE]) ]) +dnl # +dnl # Linux 5.16 API +dnl # +dnl # bio_set_dev is no longer a helper macro and is now an inline function, +dnl # meaning that the function it calls internally can no longer be overridden +dnl # by our code +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV_MACRO], [ + ZFS_LINUX_TEST_SRC([bio_set_dev_macro], [ + #include <linux/bio.h> + #include <linux/fs.h> + ],[ + #ifndef bio_set_dev + #error Not a macro + #endif + ], [], [ZFS_META_LICENSE]) +]) + AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [ AC_MSG_CHECKING([whether bio_set_dev() is available]) ZFS_LINUX_TEST_RESULT([bio_set_dev], [ @@ -205,6 +223,15 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [ AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1, [bio_set_dev() GPL-only]) ]) + + AC_MSG_CHECKING([whether bio_set_dev() is a macro]) + ZFS_LINUX_TEST_RESULT([bio_set_dev_macro], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BIO_SET_DEV_MACRO, 1, + [bio_set_dev() is a macro]) + ],[ + AC_MSG_RESULT(no) + ]) ],[ AC_MSG_RESULT(no) ]) @@ -434,6 +461,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [ ZFS_AC_KERNEL_SRC_BLKG_TRYGET ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK ZFS_AC_KERNEL_SRC_BDEV_SUBMIT_BIO_RETURNS_VOID + ZFS_AC_KERNEL_SRC_BIO_SET_DEV_MACRO ]) AC_DEFUN([ZFS_AC_KERNEL_BIO], [ |