diff options
author | Johannes Thumshirn <jthumshirn@suse.de> | 2019-06-03 17:58:56 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-07-01 14:35:01 +0300 |
commit | 6d97c6e31b553bc9f58b83ac3c4c79c17affbda8 (patch) | |
tree | 1630ce58106d085e9a5d0f08fe25d57f967f4b6a /fs/btrfs/ctree.h | |
parent | 51bce6c9b97729835bb55ceb37febd5c8fa962dd (diff) | |
download | linux-6d97c6e31b553bc9f58b83ac3c4c79c17affbda8.tar.xz |
btrfs: add boilerplate code for directly including the crypto framework
Add boilerplate code for directly including the crypto framework. This
helps us flipping the switch for 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>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index a66ed58058d9..2e908c557fb2 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -73,6 +73,7 @@ struct btrfs_ref; /* four bytes for CRC32 */ static const int btrfs_csum_sizes[] = { 4 }; +static const char *btrfs_csum_names[] = { "crc32c" }; #define BTRFS_EMPTY_DIR_SIZE 0 @@ -1163,6 +1164,8 @@ struct btrfs_fs_info { spinlock_t swapfile_pins_lock; struct rb_root swapfile_pins; + struct crypto_shash *csum_shash; + #ifdef CONFIG_BTRFS_FS_REF_VERIFY spinlock_t ref_verify_lock; struct rb_root block_tree; @@ -2454,6 +2457,11 @@ static inline int btrfs_super_csum_size(const struct btrfs_super_block *s) return btrfs_csum_sizes[t]; } +static inline const char *btrfs_super_csum_name(u16 csum_type) +{ + /* csum type is validated at mount time */ + return btrfs_csum_names[csum_type]; +} /* * The leaf data grows from end-to-front in the node. |