btrfs: don't assume compressed_bio sums to be 4 bytes

BTRFS has the implicit assumption that a checksum in compressed_bio is 4
bytes. While this is true for CRC32C, it is not for any other checksum.

Change the data type to be a byte array and adjust loop index calculation
accordingly.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Johannes Thumshirn 2019-05-22 10:19:02 +02:00 committed by David Sterba
parent 1e25a2e3ca
commit 10fe6ca80d
3 changed files with 19 additions and 12 deletions

View file

@ -61,7 +61,7 @@ struct compressed_bio {
* the start of a variable length array of checksums only
* used by reads
*/
u32 sums;
u8 sums[];
};
static inline unsigned int btrfs_compress_type(unsigned int type_level)