diff options
author | David Sterba <dsterba@suse.com> | 2019-05-16 13:39:59 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-07-01 13:34:53 +0200 |
commit | 9b4e675a9978800995f83af0ed90e890ca501f31 (patch) | |
tree | 4a24a502eddfcfa47903ec366aa36e89d5722eef /fs/btrfs/ctree.h | |
parent | btrfs: extent-tree: Refactor add_pinned_bytes() to add|sub_pinned_bytes() (diff) | |
download | linux-9b4e675a9978800995f83af0ed90e890ca501f31.tar.xz linux-9b4e675a9978800995f83af0ed90e890ca501f31.zip |
btrfs: detect fast implementation of crc32c on all architectures
Currently, there's only check for fast crc32c implementation on X86,
based on the CPU flags. This is used to decide if checksumming should be
offloaded to worker threads or can be calculated by the caller.
As there are more architectures that implement a faster version of
crc32c (ARM, SPARC, s390, MIPS, PowerPC), also there are specialized hw
cards.
The detection is based on driver name, all generic C implementations
contain 'generic', while the specialized versions do not. Alternatively
the priority could be used, but this is not currently provided by the
crypto API.
The flag is set per-filesystem at mount time and used for the offloading
decisions.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 0a61dff27f57..02870c1bb68a 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -791,6 +791,12 @@ enum { /* Indicate that the cleaner thread is awake and doing something. */ BTRFS_FS_CLEANER_RUNNING, + + /* + * The checksumming has an optimized version and is considered fast, + * so we don't need to offload checksums to workqueues. + */ + BTRFS_FS_CSUM_IMPL_FAST, }; struct btrfs_fs_info { |