• Q
    btrfs: scrub: refactor scrub_find_csum() · 480a8ec8
    Qu Wenruo 提交于
    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: NQu Wenruo <wqu@suse.com>
    Signed-off-by: NDavid Sterba <dsterba@suse.com>
    480a8ec8
scrub.c 108.2 KB