]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: make csum_tree_block() handle node smaller than page
authorQu Wenruo <wqu@suse.com>
Tue, 3 Nov 2020 13:30:47 +0000 (21:30 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:54:04 +0000 (15:54 +0100)
commit7801cd01c889b3b5a722fdb0cf33fad9b3bdf9f9
treea76df3b11742d661a8796315d69399338f99b86e
parent57f2f20c6b1c9a134c5c10205ef8b16a28c84130
btrfs: make csum_tree_block() handle node smaller than page

For subpage size support, metadata blocks of nodesize are smaller than
one page and this needs to be handled when calculating the checksum.

The checksummed start and length need to be adjusted but only for the
first page:

- start is simply offset in the page

- length is nodesize (subpage) or PAGE_SIZE for all other cases

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c