summaryrefslogtreecommitdiff
path: root/fs/bcachefs/checksum.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-11-11 12:11:33 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:17 -0400
commit6404dcc9c246c1b71ace52c1a942c675c89c4ffe (patch)
tree422120ffed59311182670efdb45a2bfa934dc1c7 /fs/bcachefs/checksum.h
parente3f2db39b39b69538db5bfbd9e359e99dcf1c986 (diff)
bcachefs: More enum strings
This patch converts more enums in the on disk format to our standard x-macro-with-strings deal - to enable better pretty-printing. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/checksum.h')
-rw-r--r--fs/bcachefs/checksum.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/bcachefs/checksum.h b/fs/bcachefs/checksum.h
index 6841fb16568a..f5c1a609c5c4 100644
--- a/fs/bcachefs/checksum.h
+++ b/fs/bcachefs/checksum.h
@@ -13,9 +13,9 @@ static inline bool bch2_checksum_mergeable(unsigned type)
{
switch (type) {
- case BCH_CSUM_NONE:
- case BCH_CSUM_CRC32C:
- case BCH_CSUM_CRC64:
+ case BCH_CSUM_none:
+ case BCH_CSUM_crc32c:
+ case BCH_CSUM_crc64:
return true;
default:
return false;
@@ -78,13 +78,13 @@ static inline enum bch_csum_type bch2_csum_opt_to_type(enum bch_csum_opts type,
{
switch (type) {
case BCH_CSUM_OPT_none:
- return BCH_CSUM_NONE;
+ return BCH_CSUM_none;
case BCH_CSUM_OPT_crc32c:
- return data ? BCH_CSUM_CRC32C : BCH_CSUM_CRC32C_NONZERO;
+ return data ? BCH_CSUM_crc32c : BCH_CSUM_crc32c_nonzero;
case BCH_CSUM_OPT_crc64:
- return data ? BCH_CSUM_CRC64 : BCH_CSUM_CRC64_NONZERO;
+ return data ? BCH_CSUM_crc64 : BCH_CSUM_crc64_nonzero;
case BCH_CSUM_OPT_xxhash:
- return BCH_CSUM_XXHASH;
+ return BCH_CSUM_xxhash;
default:
BUG();
}
@@ -95,8 +95,8 @@ static inline enum bch_csum_type bch2_data_checksum_type(struct bch_fs *c,
{
if (c->sb.encryption_type)
return c->opts.wide_macs
- ? BCH_CSUM_CHACHA20_POLY1305_128
- : BCH_CSUM_CHACHA20_POLY1305_80;
+ ? BCH_CSUM_chacha20_poly1305_128
+ : BCH_CSUM_chacha20_poly1305_80;
return bch2_csum_opt_to_type(opt, true);
}
@@ -104,7 +104,7 @@ static inline enum bch_csum_type bch2_data_checksum_type(struct bch_fs *c,
static inline enum bch_csum_type bch2_meta_checksum_type(struct bch_fs *c)
{
if (c->sb.encryption_type)
- return BCH_CSUM_CHACHA20_POLY1305_128;
+ return BCH_CSUM_chacha20_poly1305_128;
return bch2_csum_opt_to_type(c->opts.metadata_checksum, false);
}