btrfs: use file_offset to limit bios size in calc_bio_boundaries
authorChristoph Hellwig <hch@lst.de>
Mon, 12 Dec 2022 07:37:18 +0000 (08:37 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 15 Feb 2023 18:38:55 +0000 (19:38 +0100)
commit72fcf1a47b8daba82ffdeddd630688df5ac1bddb
tree87c4386bf98745d0ef31571312884b2bf11b8da8
parenta724f313f84beb5b63b8844d9ec42a547e4a3c18
btrfs: use file_offset to limit bios size in calc_bio_boundaries

btrfs_ordered_extent->disk_bytenr can be rewritten by the zoned I/O
completion handler, and thus in general is not a good idea to limit I/O
size.  But the maximum bio size calculation can easily be done using the
file_offset fields in the btrfs_ordered_extent and btrfs_bio structures,
so switch to that instead.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c