summaryrefslogtreecommitdiff
path: root/fs/btrfs/hash.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2015-09-16 15:34:53 +0200
committerDavid Sterba <dsterba@suse.com>2016-06-06 14:08:28 +0200
commit5f9e1059d9347191b271bf7d13bd83db57594d2a (patch)
treef23ae20ffd41ac1405e51e75b25e4e19de580179 /fs/btrfs/hash.c
parente06cd3dd7cea50e87663a88acdfdb7ac1c53a5ca (diff)
btrfs: advertise which crc32c implementation is being used at module load
Since several architectures support hardware-accelerated crc32c calculation, it would be nice to confirm that btrfs is actually using it. We can see an elevated use count for the module, but it doesn't actually show who the users are. This patch simply prints the name of the driver after successfully initializing the shash. Signed-off-by: Jeff Mahoney <jeffm@suse.com> [ added a helper and used in module load-time message ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/hash.c')
-rw-r--r--fs/btrfs/hash.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/hash.c b/fs/btrfs/hash.c
index aae520b2aee5..a97fdc156a03 100644
--- a/fs/btrfs/hash.c
+++ b/fs/btrfs/hash.c
@@ -24,6 +24,11 @@ int __init btrfs_hash_init(void)
return PTR_ERR_OR_ZERO(tfm);
}
+const char* btrfs_crc32c_impl(void)
+{
+ return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm));
+}
+
void btrfs_hash_exit(void)
{
crypto_free_shash(tfm);