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>
Tue, 15 Feb 2022 15:56:37 +0000 (16:56 +0100)
commit175c223e5452422bd9d6a7364f6fda27fe05fb25
treec74438d34bf4ba5dbb0cd65074d1efbf7bcfefc3
parente851af6b75bfb8726da0f07a8e1b1b34950c09dd
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