On Thu, May 16, 2019 at 10:48:01AM +0200, Johannes Thumshirn wrote:
> Currently btrfs_csum_data() relied on the crc32c() wrapper around the crypto
> framework for calculating the CRCs.
>
> As we have our own crypto_shash structure in the fs_info now, we can
> directly call into the crypto framework without going trough the wrapper.
>
> This way we can even remove the btrfs_csum_data() and btrfs_csum_final()
> wrappers.
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@xxxxxxx>
>
> ---
> Changes to v1:
> - merge with 'btrfs: pass in an fs_info to btrfs_csum_{data,final}()'
> - Remove btrfs_csum_data() and btrfs_csum_final() alltogether
> - don't use LIBCRC32C but CRYPTO_CRC32C in KConfig
> ---
> fs/btrfs/Kconfig | 2 +-
> fs/btrfs/check-integrity.c | 12 +++++++----
> fs/btrfs/compression.c | 19 +++++++++++------
> fs/btrfs/disk-io.c | 51 +++++++++++++++++++++++++---------------------
> fs/btrfs/disk-io.h | 2 --
> fs/btrfs/file-item.c | 18 ++++++++--------
> fs/btrfs/inode.c | 24 ++++++++++++++--------
> fs/btrfs/scrub.c | 37 +++++++++++++++++++++++++--------
> 8 files changed, 104 insertions(+), 61 deletions(-)
>
> diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
> index 23537bc8c827..8f48c3be709e 100644
> --- a/fs/btrfs/Kconfig
> +++ b/fs/btrfs/Kconfig
> @@ -2,7 +2,7 @@
>
> config BTRFS_FS
> tristate "Btrfs filesystem support"
> - select LIBCRC32C
> + select CRYPTO_CRC32C
This reverts changed done in 9678c54388b6a6b309ff7ee5c8d23fa9eba7c06f,
using LIBCRC32C adds the module dependency so this is automatically picked
when building the initrd. CRYPTO_CRC32C needed workarounds to manually
pick crc32c when btrfs was detected.
But we'll need some way to add the dependencies for all the other crypto
modules, that do not have the lib.