btrfs: add common checksum type validation
authorJohannes Thumshirn <jthumshirn@suse.de>
Mon, 3 Jun 2019 14:58:53 +0000 (16:58 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 1 Jul 2019 11:35:01 +0000 (13:35 +0200)
commite7e16f4882edb5935ff0ba81a0df25ae0b80b549
tree2f285c655eec50448a3ae213359bb36b706f6408
parent7ebc7e5f2c81f658b1d2f95fcde15dfd1a84b370
btrfs: add common checksum type validation

Currently btrfs is only supporting CRC32C as checksumming algorithm. As
this is about to change provide a function to validate the checksum type
in the superblock against all possible algorithms.

This makes adding new algorithms easier as there are fewer places to
adjust when adding new algorithms.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c