]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: do not allocate a btrfs_bio for low-level bios
authorChristoph Hellwig <hch@lst.de>
Thu, 26 May 2022 07:36:42 +0000 (09:36 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:33 +0000 (17:45 +0200)
commitf525fbd3c52af46e8557c5303272af39aeec7f1a
tree2ec805674d832a7784c9440c800c088ef0b21107
parent1f6b97098152a369f6f2816bd9715265b8aea97a
btrfs: do not allocate a btrfs_bio for low-level bios

The bios submitted from btrfs_map_bio don't really interact with the
rest of btrfs and the only btrfs_bio member actually used in the
low-level bios is the pointer to the btrfs_io_context used for endio
handler.

Use a union in struct btrfs_io_stripe that allows the endio handler to
find the btrfs_io_context and remove the spurious ->device assignment
so that a plain fs_bio_set bio can be used for the low-level bios
allocated inside btrfs_map_bio.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/volumes.c
fs/btrfs/volumes.h