]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: simplify eb checksum verification in btrfs_validate_metadata_buffer
authorDavid Sterba <dsterba@suse.com>
Mon, 21 Sep 2020 20:07:14 +0000 (22:07 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:06 +0000 (15:19 +0200)
commit4b275189d9983882f4d6010a21eb87d7a1ad6f3d
tree80d7b01eac20d8439dd9b96c37777c5f4871d8b2
parent6ee546a6fc94251e7fb7e351fdd3bb5dadc6d2cf
btrfs: simplify eb checksum verification in btrfs_validate_metadata_buffer

The verification copies the calculated checksum bytes to a temporary
buffer but this is not necessary. We can map the eb header on the first
page and use the checksum bytes directly.

This saves at least one function call and boundary checks so it could
lead to a minor performance improvement.

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