summaryrefslogtreecommitdiff
path: root/fs/bcachefs/extents.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-06-28 23:25:39 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-07-15 02:00:16 +0300
commit9d9d212e26399c04c567c232f500179cbdc8dc7e (patch)
tree38d718d661c5cd0070d503d0da181b1fb6a2dc7d /fs/bcachefs/extents.c
parent5e3c208325189df6d0c08307cbadb2a03b2fbe2e (diff)
downloadlinux-9d9d212e26399c04c567c232f500179cbdc8dc7e.tar.xz
bcachefs: bch2_extent_crc_unpacked_to_text()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/extents.c')
-rw-r--r--fs/bcachefs/extents.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index 410b8bd81b5a..057df38fccf8 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -1034,6 +1034,18 @@ void bch2_extent_ptr_to_text(struct printbuf *out, struct bch_fs *c, const struc
--out->atomic;
}
+void bch2_extent_crc_unpacked_to_text(struct printbuf *out, struct bch_extent_crc_unpacked *crc)
+{
+ 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_prt_csum_type(out, crc->csum_type);
+ prt_printf(out, " %0llx:%0llx ", crc->csum.hi, crc->csum.lo);
+ prt_str(out, " compress ");
+ bch2_prt_compression_type(out, crc->compression_type);
+}
+
void bch2_bkey_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
struct bkey_s_c k)
{
@@ -1059,13 +1071,7 @@ 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 ",
- crc.compressed_size,
- crc.uncompressed_size,
- crc.offset, crc.nonce);
- bch2_prt_csum_type(out, crc.csum_type);
- prt_str(out, " compress ");
- bch2_prt_compression_type(out, crc.compression_type);
+ bch2_extent_crc_unpacked_to_text(out, &crc);
break;
}
case BCH_EXTENT_ENTRY_stripe_ptr: {
@@ -1096,6 +1102,7 @@ void bch2_bkey_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
}
}
+
static int extent_ptr_invalid(struct bch_fs *c,
struct bkey_s_c k,
enum bch_validate_flags flags,