From 3c0b8c874bff37e7ba10c07efb115852346d1fc0 Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Mon, 26 Dec 2022 22:59:13 -0500 Subject: [PATCH] linux 6.2 compat: bio->bi_rw was renamed bio->bi_opf The bi_rw member of struct bio was renamed to bi_opf in Linux 6.2. As well, Linux's implementation of bio_set_op_attrs(...) has been removed. The HAVE_BIO_BI_OPF macro already appears to be defined, but the removal of the bio_set_op_attrs(...) implementation makes the build fall back on the locally-defined implementation, which isn't updated for the bio->bi_opf change. This commit adds that update. Reviewed-by: Richard Yao Reviewed-by: Brian Behlendorf Reviewed-by: Tony Hutter Signed-off-by: Coleman Kane Closes #14324 Closes #14331 --- include/os/linux/kernel/linux/blkdev_compat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/os/linux/kernel/linux/blkdev_compat.h b/include/os/linux/kernel/linux/blkdev_compat.h index fd91560a3..bac5c2279 100644 --- a/include/os/linux/kernel/linux/blkdev_compat.h +++ b/include/os/linux/kernel/linux/blkdev_compat.h @@ -357,7 +357,11 @@ 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