* [PATCH[ btrfs: advertise which crc32c implementation is being used on mount
@ 2015-09-16 13:34 Jeff Mahoney
0 siblings, 0 replies; only message in thread
From: Jeff Mahoney @ 2015-09-16 13:34 UTC (permalink / raw)
To: linux-btrfs
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>
---
fs/btrfs/hash.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/fs/btrfs/hash.c
+++ b/fs/btrfs/hash.c
@@ -20,8 +20,12 @@ static struct crypto_shash *tfm;
int __init btrfs_hash_init(void)
{
tfm = crypto_alloc_shash("crc32c", 0, 0);
+ if (IS_ERR(tfm))
+ return PTR_ERR(tfm);
- return PTR_ERR_OR_ZERO(tfm);
+ printk("BTRFS: using %s for crc32c\n",
+ crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm)));
+ return 0;
}
void btrfs_hash_exit(void)
--
Jeff Mahoney
SUSE Labs
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-16 13:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 13:34 [PATCH[ btrfs: advertise which crc32c implementation is being used on mount Jeff Mahoney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).