]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: simplify tree block checksumming loop
authorDavid Sterba <dsterba@suse.com>
Thu, 27 Feb 2020 20:00:47 +0000 (21:00 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:52 +0000 (17:01 +0100)
commit4e247d4936996afe18f5786ef85a9314dc4946a2
treeae2abf74cff5203e1e4d985da7719c59ffe51ac4
parent5f857606d2a6142c540027e7d1a4984b84f990b3
btrfs: simplify tree block checksumming loop

Thw whole point of csum_tree_block is to iterate over all extent buffer
pages and pass it to checksumming functions. The bytes where checksum is
stored must be skipped, thus map_private_extent_buffer. This complicates
further offset calculations.

As the first page will be always present, checksum the relevant bytes
unconditionally and then do a simple iteration over the remaining pages.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c