]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: make btrfs_verify_data_csum() to return a bitmap
authorQu Wenruo <wqu@suse.com>
Mon, 3 May 2021 02:08:54 +0000 (10:08 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:05 +0000 (15:19 +0200)
commit68e096a533f8f86a3d1fa8c1cb1c1950adc74027
tree3cc939cf768fd77e62ffa8a2cc73fae2179f0131
parentfd6136c5b4a19477f9fdc0f49483308e8d9ddb08
btrfs: make btrfs_verify_data_csum() to return a bitmap

This will provide the basis for later per-sector repair for subpage,
while still keeping the existing code happy.

As if all csums match, the return value will be 0, same as now.
Only when csum mismatches, the return value is different.

The new return value will be a bitmap, for 4K sectorsize and 4K page
size, it will be either 1, instead of the -EIO (which is not used
directly by the callers, no effective change).

But for 4K sectorsize and 64K page size, aka subpage case, since the
bvec can contain multiple sectors, knowing which sectors are corrupted
will allow us to submit repair only for corrupted sectors.

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/ctree.h
fs/btrfs/inode.c