btrfs: fix and document the zoned device choice in alloc_new_bio
authorChristoph Hellwig <hch@lst.de>
Thu, 24 Mar 2022 16:52:10 +0000 (17:52 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 19 Apr 2022 13:44:49 +0000 (15:44 +0200)
commit50f1cff3d8865909727fad6f960ce5a050799d00
tree9c33dbc94627dbac84e81fe092021c4bcc77e516
parent50ff57888d0b13440e7f4cde05dc339ee8d0f1f8
btrfs: fix and document the zoned device choice in alloc_new_bio

Zone Append bios only need a valid block device in struct bio, but
not the device in the btrfs_bio.  Use the information from
btrfs_zoned_get_device to set up bi_bdev and fix zoned writes on
multi-device file system with non-homogeneous capabilities and remove
the pointless btrfs_bio.device assignment.

Add big fat comments explaining what is going on here.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c