diff options
author | jpsollie <janpieter.sollie@edpnet.be> | 2021-06-17 13:42:09 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:07 -0400 |
commit | 41e633826a1418f3b492d9137d395289e6e67d15 (patch) | |
tree | 85a3d530f3f30e0b3d5ffafac938d73c132845da /fs/bcachefs/bcachefs_format.h | |
parent | 80ff5d18ee975f201c8913be066ebedf887003f9 (diff) |
bcachefs: add bcachefs xxhash support
xxhash is a much faster algorithm compared to crc32.
could be used to speed up checksum calculation.
xxhash 64-bit only, as it is much faster on 64-bit CPUs compared to xxh32.
Signed-off-by: jpsollie <janpieter.sollie@edpnet.be>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs_format.h')
-rw-r--r-- | fs/bcachefs/bcachefs_format.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h index 6cfb8959d579..63f7c7c8f390 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -1460,7 +1460,8 @@ enum bch_csum_type { BCH_CSUM_CHACHA20_POLY1305_128 = 4, BCH_CSUM_CRC32C = 5, BCH_CSUM_CRC64 = 6, - BCH_CSUM_NR = 7, + BCH_CSUM_XXHASH = 7, + BCH_CSUM_NR = 8, }; static const unsigned bch_crc_bytes[] = { @@ -1469,6 +1470,7 @@ static const unsigned bch_crc_bytes[] = { [BCH_CSUM_CRC32C] = 4, [BCH_CSUM_CRC64_NONZERO] = 8, [BCH_CSUM_CRC64] = 8, + [BCH_CSUM_XXHASH] = 8, [BCH_CSUM_CHACHA20_POLY1305_80] = 10, [BCH_CSUM_CHACHA20_POLY1305_128] = 16, }; @@ -1487,7 +1489,8 @@ static inline _Bool bch2_csum_type_is_encryption(enum bch_csum_type type) #define BCH_CSUM_OPTS() \ x(none, 0) \ x(crc32c, 1) \ - x(crc64, 2) + x(crc64, 2) \ + x(xxhash, 3) enum bch_csum_opts { #define x(t, n) BCH_CSUM_OPT_##t = n, |