Skip to content

Commit 89f547c

Browse files
morbidrsakdave
authored andcommitted
btrfs: open code set_io_stripe for RAID56
Open code set_io_stripe() for RAID56, as it a) uses a different method to calculate the stripe_index b) doesn't need to go through raid-stripe-tree mapping code. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent b55b307 commit 89f547c

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

fs/btrfs/volumes.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6670,13 +6670,15 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
66706670
btrfs_stripe_nr_to_offset(io_geom.stripe_nr *
66716671
nr_data_stripes(map));
66726672
for (int i = 0; i < io_geom.num_stripes; i++) {
6673-
ret = set_io_stripe(fs_info, op, logical, length,
6674-
&bioc->stripes[i], map,
6675-
(i + io_geom.stripe_nr) % io_geom.num_stripes,
6676-
io_geom.stripe_offset,
6677-
io_geom.stripe_nr);
6678-
if (ret < 0)
6679-
break;
6673+
struct btrfs_io_stripe *dst = &bioc->stripes[i];
6674+
u32 stripe_index;
6675+
6676+
stripe_index = (i + io_geom.stripe_nr) % io_geom.num_stripes;
6677+
dst->dev = map->stripes[stripe_index].dev;
6678+
dst->physical =
6679+
map->stripes[stripe_index].physical +
6680+
io_geom.stripe_offset +
6681+
btrfs_stripe_nr_to_offset(io_geom.stripe_nr);
66806682
}
66816683
} else {
66826684
/*

0 commit comments

Comments
 (0)