summaryrefslogtreecommitdiff
path: root/fs/bcachefs/checksum.h
diff options
context:
space:
mode:
authorjpsollie <janpieter.sollie@edpnet.be>2021-06-17 13:42:09 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:07 -0400
commit41e633826a1418f3b492d9137d395289e6e67d15 (patch)
tree85a3d530f3f30e0b3d5ffafac938d73c132845da /fs/bcachefs/checksum.h
parent80ff5d18ee975f201c8913be066ebedf887003f9 (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/checksum.h')
-rw-r--r--fs/bcachefs/checksum.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/checksum.h b/fs/bcachefs/checksum.h
index 728b7ef1a149..6841fb16568a 100644
--- a/fs/bcachefs/checksum.h
+++ b/fs/bcachefs/checksum.h
@@ -83,6 +83,8 @@ static inline enum bch_csum_type bch2_csum_opt_to_type(enum bch_csum_opts type,
return data ? BCH_CSUM_CRC32C : BCH_CSUM_CRC32C_NONZERO;
case BCH_CSUM_OPT_crc64:
return data ? BCH_CSUM_CRC64 : BCH_CSUM_CRC64_NONZERO;
+ case BCH_CSUM_OPT_xxhash:
+ return BCH_CSUM_XXHASH;
default:
BUG();
}