summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/extents.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-04-12 15:17:00 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-04-13 22:48:17 -0400
commit9abb6dd7ce5a261f7aebf6f396b50a63db71133f (patch)
tree81d697fe0dd172159d9da17c6f69a494681e6f93 /fs/bcachefs/extents.c
parentba8ed36e72033dd6b89d44145f323e6c4508bfc9 (diff)
downloadlinux-9abb6dd7ce5a261f7aebf6f396b50a63db71133f.tar.gz
linux-9abb6dd7ce5a261f7aebf6f396b50a63db71133f.tar.bz2
linux-9abb6dd7ce5a261f7aebf6f396b50a63db71133f.zip
bcachefs: Standardize helpers for printing enum strs with bounds checks
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/extents.c')
-rw-r--r--fs/bcachefs/extents.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index 36d12d2adb81..1a331e539204 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -1030,11 +1030,12 @@ void bch2_bkey_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
struct bch_extent_crc_unpacked crc =
bch2_extent_crc_unpack(k.k, entry_to_crc(entry));
- prt_printf(out, "crc: c_size %u size %u offset %u nonce %u csum %s compress ",
+ prt_printf(out, "crc: c_size %u size %u offset %u nonce %u csum ",
crc.compressed_size,
crc.uncompressed_size,
- crc.offset, crc.nonce,
- bch2_csum_types[crc.csum_type]);
+ crc.offset, crc.nonce);
+ bch2_prt_csum_type(out, crc.csum_type);
+ prt_str(out, " compress ");
bch2_prt_compression_type(out, crc.compression_type);
break;
}