Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

btrfs: stop parsing crc32c driver name

To determine whether the crc32c implementation is "fast", use
crc32_optimizations() instead of parsing the crypto_shash driver name.
This keeps the code working as intended after the driver name is changed
by the next commit.

Acked-by: David Sterba <dsterba@suse.com>
Link: https://lore.kernel.org/r/20250613183753.31864-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>

+2 -6
+2 -6
fs/btrfs/disk-io.c
··· 2028 2028 2029 2029 fs_info->csum_shash = csum_shash; 2030 2030 2031 - /* 2032 - * Check if the checksum implementation is a fast accelerated one. 2033 - * As-is this is a bit of a hack and should be replaced once the csum 2034 - * implementations provide that information themselves. 2035 - */ 2031 + /* Check if the checksum implementation is a fast accelerated one. */ 2036 2032 switch (csum_type) { 2037 2033 case BTRFS_CSUM_TYPE_CRC32: 2038 - if (!strstr(crypto_shash_driver_name(csum_shash), "generic")) 2034 + if (crc32_optimizations() & CRC32C_OPTIMIZATION) 2039 2035 set_bit(BTRFS_FS_CSUM_IMPL_FAST, &fs_info->flags); 2040 2036 break; 2041 2037 case BTRFS_CSUM_TYPE_XXHASH: