Skip to content

Commit

Permalink
linux 6.2 compat: bio->bi_rw was renamed bio->bi_opf
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Coleman Kane <[email protected]>
Closes #14324
Closes #14331
  • Loading branch information
ckane authored and behlendorf committed Jan 6, 2023
1 parent 884a693 commit a0105f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/os/linux/kernel/linux/blkdev_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,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

Expand Down

0 comments on commit a0105f6

Please sign in to comment.