]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita13785f494edd4b4b2565b1e110e762cd217c523
tree574b87ff59d57aa5cdd6c41af428d76faca992ce
parent9c00ce85fec85537b82fd250857d4c35c7c61014
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