btrfs: don't allocate a btrfs_bio for raid56 per-stripe bios

Except for the spurious initialization of ->device just after allocation
nothing uses the btrfs_bio, so just allocate a normal bio without extra
data.

Reviewed-by: Qu Wenruo <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
This commit is contained in:
Christoph Hellwig authored and David Sterba committed 2022-05-16 17:03:12 +02:00
1 parent e01bf588f8
commit e1b4b44e00
1 file changed
+2 -5
+2 -5
View File
@@ -1082,11 +1082,8 @@ static int rbio_add_io_page(struct btrfs_raid_bio *rbio,
}
/* put a new bio on the list */
bio = btrfs_bio_alloc(bio_max_len >> PAGE_SHIFT ?: 1);
btrfs_bio(bio)->device = stripe->dev;
bio->bi_iter.bi_size = 0;
bio_set_dev(bio, stripe->dev->bdev);
bio->bi_opf = opf;
bio = bio_alloc(stripe->dev->bdev, max(bio_max_len >> PAGE_SHIFT, 1UL),
opf, GFP_NOFS);
bio->bi_iter.bi_sector = disk_start >> 9;
bio->bi_private = rbio;