From ea8a9768e71d9cbace1a40156ed185e0c73ec0ea Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Fri, 16 Aug 2024 16:05:21 +1000 Subject: [PATCH] config: remove HAVE_BIO_BI_OPF 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 | 18 -------------- include/os/linux/kernel/linux/blkdev_compat.h | 24 ++----------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/config/kernel-bio.m4 b/config/kernel-bio.m4 index 1b88f33ee..8d2af88d2 100644 --- a/config/kernel-bio.m4 +++ b/config/kernel-bio.m4 @@ -102,13 +102,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_OPS], [ int op __attribute__ ((unused)) = REQ_OP_FLUSH; ]) - ZFS_LINUX_TEST_SRC([bio_bi_opf], [ - #include - ],[ - struct bio bio __attribute__ ((unused)); - bio.bi_opf = 0; - ]) - ZFS_LINUX_TEST_SRC([bio_set_op_attrs], [ #include ],[ @@ -148,16 +141,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH], [ ]) ]) -AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [ - AC_MSG_CHECKING([whether bio->bi_opf is defined]) - ZFS_LINUX_TEST_RESULT([bio_bi_opf], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BIO_BI_OPF, 1, [bio->bi_opf is defined]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_OP_ATTRS], [ AC_MSG_CHECKING([whether bio_set_op_attrs is available]) ZFS_LINUX_TEST_RESULT([bio_set_op_attrs], [ @@ -432,7 +415,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO], [ ZFS_AC_KERNEL_BIO_REQ_OP_DISCARD ZFS_AC_KERNEL_BIO_REQ_OP_SECURE_ERASE ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH - ZFS_AC_KERNEL_BIO_BI_OPF ZFS_AC_KERNEL_BIO_SET_OP_ATTRS ZFS_AC_KERNEL_BIO_SET_DEV diff --git a/include/os/linux/kernel/linux/blkdev_compat.h b/include/os/linux/kernel/linux/blkdev_compat.h index 891ff4403..c9a4d0d34 100644 --- a/include/os/linux/kernel/linux/blkdev_compat.h +++ b/include/os/linux/kernel/linux/blkdev_compat.h @@ -399,11 +399,7 @@ vdev_lookup_bdev(const char *path, dev_t *dev) static inline void bio_set_op_attrs(struct bio *bio, unsigned rw, unsigned flags) { -#if defined(HAVE_BIO_BI_OPF) bio->bi_opf = rw | flags; -#else - bio->bi_rw |= rw | flags; -#endif /* HAVE_BIO_BI_OPF */ } #endif @@ -446,9 +442,6 @@ bio_set_flush(struct bio *bio) * 4.8-rc0 - 4.8-rc1, * REQ_PREFLUSH * - * 2.6.36 - 4.7 API, - * REQ_FLUSH - * * in all cases but may have a performance impact for some kernels. It * has the advantage of minimizing kernel specific changes in the zvol code. * @@ -456,14 +449,10 @@ bio_set_flush(struct bio *bio) static inline boolean_t bio_is_flush(struct bio *bio) { -#if defined(HAVE_REQ_OP_FLUSH) && defined(HAVE_BIO_BI_OPF) +#if defined(HAVE_REQ_OP_FLUSH) return ((bio_op(bio) == REQ_OP_FLUSH) || (bio->bi_opf & REQ_PREFLUSH)); -#elif defined(HAVE_REQ_PREFLUSH) && defined(HAVE_BIO_BI_OPF) +#elif defined(HAVE_REQ_PREFLUSH) return (bio->bi_opf & REQ_PREFLUSH); -#elif defined(HAVE_REQ_PREFLUSH) && !defined(HAVE_BIO_BI_OPF) - return (bio->bi_rw & REQ_PREFLUSH); -#elif defined(HAVE_REQ_FLUSH) - return (bio->bi_rw & REQ_FLUSH); #else #error "Unsupported kernel" #endif @@ -472,20 +461,11 @@ bio_is_flush(struct bio *bio) /* * 4.8 API, * REQ_FUA flag moved to bio->bi_opf - * - * 2.6.x - 4.7 API, - * REQ_FUA */ static inline boolean_t bio_is_fua(struct bio *bio) { -#if defined(HAVE_BIO_BI_OPF) return (bio->bi_opf & REQ_FUA); -#elif defined(REQ_FUA) - return (bio->bi_rw & REQ_FUA); -#else -#error "Allowing the build will cause fua requests to be ignored." -#endif } /*