aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/compression.h
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2019-05-22 04:19:02 -0400
committerDavid Sterba <dsterba@suse.com>2019-07-01 07:35:01 -0400
commit10fe6ca80d9d25eca9fd6d98eccf6c795532fe96 (patch)
treeed36a8a59ff0e86913f9b9492d5a743e769f3404 /fs/btrfs/compression.h
parent1e25a2e3ca0dab0ed1030570e95d98af47113eae (diff)
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>
Diffstat (limited to 'fs/btrfs/compression.h')
-rw-r--r--fs/btrfs/compression.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index 9976fe0f7526..191e5f4e3523 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -61,7 +61,7 @@ struct compressed_bio {
61 * the start of a variable length array of checksums only 61 * the start of a variable length array of checksums only
62 * used by reads 62 * used by reads
63 */ 63 */
64 u32 sums; 64 u8 sums[];
65}; 65};
66 66
67static inline unsigned int btrfs_compress_type(unsigned int type_level) 67static inline unsigned int btrfs_compress_type(unsigned int type_level)