]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: factor our read/write stage off csum_tree_block into its callers
authorJohannes Thumshirn <jthumshirn@suse.de>
Mon, 25 Feb 2019 13:24:15 +0000 (14:24 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:17 +0000 (19:02 +0200)
commit8e4b718daa76e02e3943e68feebf557941823286
tree76806b250a9b1ba2b7e694f225488e2813910dd2
parentafb3184ca636b51f34e5c758b5414acecf4ca2f8
btrfs: factor our read/write stage off csum_tree_block into its callers

Currently csum_tree_block() does two things, first it as it's name
suggests it calculates the checksum for a tree-block. But it also writes
this checksum to disk or reads an extent_buffer from disk and compares the
checksum with the calculated checksum, depending on the verify argument.

Furthermore one of the two callers passes in '1' for the verify argument,
the other one passes in '0'.

For clarity and less layering violations, factor out the second stage in
csum_tree_block()'s callers.

Suggested-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c