btrfs: scrub: introduce dedicated helper to scrub simple-mirror based range
authorQu Wenruo <wqu@suse.com>
Fri, 11 Mar 2022 07:38:43 +0000 (15:38 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2022 15:17:30 +0000 (17:17 +0200)
commit09022b14fafc86904f237b0463877d5d36f8cc17
treeedf93fdb25b9f3e13cc435b029f249bb3446b749
parent416bd7e7af602a14c41d87a94bec36a052d87181
btrfs: scrub: introduce dedicated helper to scrub simple-mirror based range

The new helper, scrub_simple_mirror(), will scrub all extents inside a
range which only has simple mirror based duplication.

This covers every range of SINGLE/DUP/RAID1/RAID1C*, and inside each
data stripe for RAID0/RAID10.

Currently we will use this function to scrub SINGLE/DUP/RAID1/RAID1C*
profiles.  As one can see, the new entrance for those simple-mirror
based profiles can be small enough (with comments, just reach 100
lines).

This function will be the basis for the incoming scrub refactor.

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