btrfs: raid56: avoid double for loop inside finish_rmw()
authorQu Wenruo <wqu@suse.com>
Thu, 2 Jun 2022 07:51:18 +0000 (15:51 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:34 +0000 (17:45 +0200)
commit369200446564f04b5cd14596d69e17880be7d926
treef7d20d889d34b4de3d2533731c0dde8e1e40cca3
parentf31f09f6be1c6c1a673e0566e258281a7bbaaa51
btrfs: raid56: avoid double for loop inside finish_rmw()

We can easily calculate the stripe number and sector number inside the
stripe.  Thus there is not much need for a double for loop.

For the only case we want to skip the whole stripe, we can manually
increase @total_sector_nr.
This is not a recommended behavior, thus every time the iterator gets
modified there will be a comment along with an ASSERT() for it.

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