btrfs: introduce dedicated helper to scrub simple-mirror based range
authorQu Wenruo <wqu@suse.com>
Fri, 7 Jan 2022 02:34:28 +0000 (10:34 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 Feb 2022 16:02:09 +0000 (17:02 +0100)
commit6e30b6ef85bc25cb4631a6ffdb5eb7776bf687f3
tree077ee4b679b180ec7f179c91f26155d2962a8401
parentb949f0245b13ccd264dad2dd5eba0886013dbcc5
btrfs: 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