btrfs: simplify data stripe calculation helpers
authorDavid Sterba <dsterba@suse.com>
Mon, 26 Jul 2021 12:15:24 +0000 (14:15 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Aug 2021 11:19:03 +0000 (13:19 +0200)
commitd58ede8d1d9fb0f70d6aa51fa6550d2d580f8c17
tree574b87ff59d57aa5cdd6c41af428d76faca992ce
parentfe4f46d40c1c2ff78a8a7280e455f115c32e6b41
btrfs: simplify data stripe calculation helpers

There are two helpers doing the same calculations based on nparity and
ncopies. calc_data_stripes can be simplified into one expression, so far
we don't have profile with both copies and parity, so there's no
effective change. calc_stripe_length should reuse the helper and not
repeat the same calculation.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c