From a29880142646923574a19284c8faa4e7e23cbcc6 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sat, 24 Aug 2024 22:11:04 +1000 Subject: [PATCH] config: remove HAVE_BIO_SET_DEV Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf Reviewed-by: Tony Hutter Reviewed-by: Tino Reichardt Signed-off-by: Rob Norris Closes #16479 --- config/kernel-bio.m4 | 32 ++++++++++++-------------------- module/os/linux/zfs/vdev_disk.c | 11 ----------- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/config/kernel-bio.m4 b/config/kernel-bio.m4 index 85d26bae6..8afc9c59d 100644 --- a/config/kernel-bio.m4 +++ b/config/kernel-bio.m4 @@ -66,28 +66,20 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV_MACRO], [ ]) AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [ - AC_MSG_CHECKING([whether bio_set_dev() is available]) - ZFS_LINUX_TEST_RESULT([bio_set_dev], [ + AC_MSG_CHECKING([whether bio_set_dev() is GPL-only]) + ZFS_LINUX_TEST_RESULT([bio_set_dev_license], [ + AC_MSG_RESULT(no) + ],[ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BIO_SET_DEV, 1, [bio_set_dev() is available]) + AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1, + [bio_set_dev() GPL-only]) + ]) - AC_MSG_CHECKING([whether bio_set_dev() is GPL-only]) - ZFS_LINUX_TEST_RESULT([bio_set_dev_license], [ - AC_MSG_RESULT(no) - ],[ - AC_MSG_RESULT(yes) - 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_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) ]) diff --git a/module/os/linux/zfs/vdev_disk.c b/module/os/linux/zfs/vdev_disk.c index 8ce92290c..a6271d3a7 100644 --- a/module/os/linux/zfs/vdev_disk.c +++ b/module/os/linux/zfs/vdev_disk.c @@ -496,7 +496,6 @@ vdev_disk_close(vdev_t *v) */ #if !defined(HAVE_BIO_ALLOC_4ARG) -#ifdef HAVE_BIO_SET_DEV #if defined(CONFIG_BLK_CGROUP) && defined(HAVE_BIO_SET_DEV_GPL_ONLY) /* * The Linux 5.5 kernel updated percpu_ref_tryget() which is inlined by @@ -582,16 +581,6 @@ vdev_bio_set_dev(struct bio *bio, struct block_device *bdev) #define bio_set_dev vdev_bio_set_dev #endif #endif -#else -/* - * Provide a bio_set_dev() helper macro for pre-Linux 4.14 kernels. - */ -static inline void -bio_set_dev(struct bio *bio, struct block_device *bdev) -{ - bio->bi_bdev = bdev; -} -#endif /* HAVE_BIO_SET_DEV */ #endif /* !HAVE_BIO_ALLOC_4ARG */ static inline void