@@ -1095,9 +1095,18 @@ static ssize_t btrfs_checksum_show(struct kobject *kobj,
struct btrfs_fs_info *fs_info = to_fs_info(kobj);
u16 csum_type = btrfs_super_csum_type(fs_info->super_copy);
- return sysfs_emit(buf, "%s (%s)\n",
- btrfs_super_csum_name(csum_type),
- crypto_shash_driver_name(fs_info->csum_shash[CSUM_DEFAULT]));
+ return sysfs_emit(buf,
+ "%s (%s)\n"
+ "generic: %s\n"
+ "accel: %s\n",
+ btrfs_super_csum_name(csum_type),
+ crypto_shash_driver_name(fs_info->csum_shash[CSUM_DEFAULT]),
+ fs_info->csum_shash[CSUM_GENERIC]
+ ? crypto_shash_driver_name(fs_info->csum_shash[CSUM_GENERIC])
+ : "none",
+ fs_info->csum_shash[CSUM_ACCEL]
+ ? crypto_shash_driver_name(fs_info->csum_shash[CSUM_ACCEL])
+ : "none");
}
static const char csum_impl[][8] = {
Extend the sysfs FSID/checksum file and append lines with the selector strings and implementation if loaded, or 'none'. Output may look like: crc32c (crc32c-generic) generic: crc32c-generic accel: crc32c-intel Scripts that rely on single line in the file need to be updated. All available and loaded implementations can be found in /proc/crypto . Signed-off-by: David Sterba <dsterba@suse.com> --- fs/btrfs/sysfs.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)