]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: raid56: avoid double for loop inside __raid56_parity_recover()
authorQu Wenruo <wqu@suse.com>
Thu, 2 Jun 2022 07:51:19 +0000 (15:51 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:35 +0000 (17:45 +0200)
commit34a43f52c0a4be22118d1af19ea230b53cc76c0d
tree69aac14d9d727781a05394e6ca31f1f13f0f592d
parent27ab76b3c33466667008fad7d5aebb4573bcc4d2
btrfs: raid56: avoid double for loop inside __raid56_parity_recover()

The double for loop can be easily converted to single for loop as we're
really iterating the sectors in their bytenr order.

The only exception is the full stripe skip, however that can also easily
be done inside the loop.  Add an ASSERT() along with a comment for that
specific case.

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