diff options
author | Christoph Hellwig <hch@lst.de> | 2022-04-04 06:45:24 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-05-16 17:03:12 +0200 |
commit | 110ac0e5433425752c0a0d6423489023e6ba7a6d (patch) | |
tree | 0bd9fc3d92ee8606aaf5e0a8b7b99289a39f84e6 /fs/btrfs/volumes.c | |
parent | fce3f24ada5527a5266b7c878ae82a24e6f730e3 (diff) |
btrfs: pass a block_device to btrfs_bio_clone
Pass the block_device to bio_alloc_clone instead of setting it later.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 76d2a40113df..d8edd99a1c49 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -6824,12 +6824,13 @@ blk_status_t btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio, continue; } - if (dev_nr < total_devs - 1) - bio = btrfs_bio_clone(first_bio); - else + if (dev_nr < total_devs - 1) { + bio = btrfs_bio_clone(dev->bdev, first_bio); + } else { bio = first_bio; + bio_set_dev(bio, dev->bdev); + } - bio_set_dev(bio, dev->bdev); submit_stripe_bio(bioc, bio, bioc->stripes[dev_nr].physical, dev); } btrfs_bio_counter_dec(fs_info); |