btrfs: create structure to encode checksum type and length
authorJohannes Thumshirn <jthumshirn@suse.de>
Fri, 30 Aug 2019 11:36:09 +0000 (13:36 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:19 +0000 (14:59 +0200)
commitaf024ed2e0e56f27279cdba4d27a23dbb7677e40
treec7d8d0d5e4d23647c58efee6ee9db6057f127b5c
parente35b79a1070d681b4842dad27b1edaf9811da7e9
btrfs: create structure to encode checksum type and length

Create a structure to encode the type and length for the known on-disk
checksums.  This makes it easier to add new checksums later.

The structure and helpers are moved from ctree.h so they don't occupy
space in all headers including ctree.h. This save some space in the
final object.

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