]> www.infradead.org Git - users/willy/xarray.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)
commit480a8ec83b179da1c484133b0f687090e89b00c5
treed81465488070407b1c59a28fdd137e2d57374c56
parent96e63a45fb9a40ba49813c1e538358f3cedbedba
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