]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: scrub: refactor scrub_find_csum()
authorQu Wenruo <wqu@suse.com>
Tue, 3 Nov 2020 13:31:04 +0000 (21:31 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:54:05 +0000 (15:54 +0100)
commit017a14c90f61071c74ef5def225720be565e3eac
treed81465488070407b1c59a28fdd137e2d57374c56
parentf41a11f1b569a9435cc3d4aa1ac4ea1284e257ec
btrfs: scrub: refactor scrub_find_csum()

Function scrub_find_csum() is to locate the csum for bytenr @logical
from sctx->csum_list.

However it lacks a lot of comments to explain things like how the
csum_list is organized and why we need to drop csum range which is
before us.

Refactor the function by:

- Add more comments explaining the behavior
- Add comment explaining why we need to drop the csum range
- Put the csum copy in the main loop
  This is mostly for the incoming patches to make scrub_find_csum() able
  to find multiple checksums.

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