Lines Matching full:crc
273 lp.crc = bch2_extent_crc_unpack(l.k, NULL); in bch2_extent_merge()
274 rp.crc = bch2_extent_crc_unpack(r.k, NULL); in bch2_extent_merge()
278 if (lp.ptr.offset + lp.crc.offset + lp.crc.live_size != in bch2_extent_merge()
279 rp.ptr.offset + rp.crc.offset || in bch2_extent_merge()
302 if (lp.crc.compression_type != rp.crc.compression_type || in bch2_extent_merge()
303 lp.crc.nonce != rp.crc.nonce) in bch2_extent_merge()
306 if (lp.crc.offset + lp.crc.live_size + rp.crc.live_size <= in bch2_extent_merge()
307 lp.crc.uncompressed_size) { in bch2_extent_merge()
308 /* can use left extent's crc entry */ in bch2_extent_merge()
309 } else if (lp.crc.live_size <= rp.crc.offset) { in bch2_extent_merge()
310 /* can use right extent's crc entry */ in bch2_extent_merge()
313 if (lp.crc.csum_type != rp.crc.csum_type || in bch2_extent_merge()
314 lp.crc.nonce != rp.crc.nonce || in bch2_extent_merge()
315 crc_is_compressed(lp.crc) || in bch2_extent_merge()
316 !bch2_checksum_mergeable(lp.crc.csum_type)) in bch2_extent_merge()
319 if (lp.crc.offset + lp.crc.live_size != lp.crc.compressed_size || in bch2_extent_merge()
320 rp.crc.offset) in bch2_extent_merge()
323 if (lp.crc.csum_type && in bch2_extent_merge()
324 lp.crc.uncompressed_size + in bch2_extent_merge()
325 rp.crc.uncompressed_size > (c->opts.encoded_extent_max >> 9)) in bch2_extent_merge()
367 /* can use left extent's crc entry */ in bch2_extent_merge()
369 /* can use right extent's crc entry */ in bch2_extent_merge()
463 struct bch_extent_crc_unpacked crc; in bch2_can_narrow_extent_crcs() local
469 bkey_for_each_crc(k.k, ptrs, crc, i) in bch2_can_narrow_extent_crcs()
470 if (can_narrow_crc(crc, n)) in bch2_can_narrow_extent_crcs()
513 if (can_narrow_crc(p.crc, n)) { in bch2_bkey_narrow_crcs()
515 p.ptr.offset += p.crc.offset; in bch2_bkey_narrow_crcs()
516 p.crc = n; in bch2_bkey_narrow_crcs()
563 union bch_extent_crc *crc = (void *) ptrs.end; in bch2_extent_crc_append() local
581 bch2_extent_crc_pack(crc, new, type); in bch2_extent_crc_append()
614 ret += !p.ptr.cached && !crc_is_compressed(p.crc); in bch2_bkey_nr_ptrs_fully_allocated()
628 if (!p.ptr.cached && crc_is_compressed(p.crc)) in bch2_bkey_sectors_compressed()
629 ret += p.crc.compressed_size; in bch2_bkey_sectors_compressed()
638 struct bch_extent_crc_unpacked crc; in bch2_bkey_is_incompressible() local
640 bkey_for_each_crc(k.k, ptrs, crc, entry) in bch2_bkey_is_incompressible()
641 if (crc.compression_type == BCH_COMPRESSION_TYPE_incompressible) in bch2_bkey_is_incompressible()
738 struct bch_extent_crc_unpacked crc = in bch2_extent_ptr_decoded_append() local
742 if (!bch2_crc_unpacked_cmp(crc, p->crc)) { in bch2_extent_ptr_decoded_append()
747 bkey_for_each_crc(&k->k, ptrs, crc, pos) in bch2_extent_ptr_decoded_append()
748 if (!bch2_crc_unpacked_cmp(crc, p->crc)) { in bch2_extent_ptr_decoded_append()
753 bch2_extent_crc_append(k, p->crc); in bch2_extent_ptr_decoded_append()
904 (s64) p.ptr.offset + p.crc.offset - bkey_start_offset(k.k) == in bch2_bkey_matches_ptr()
939 (s64) p1.ptr.offset + p1.crc.offset - bkey_start_offset(k1.k) == in bch2_extents_match()
940 (s64) p2.ptr.offset + p2.crc.offset - bkey_start_offset(k2.k) && in bch2_extents_match()
952 p1.ptr.offset < p2.ptr.offset + p2.crc.compressed_size) || in bch2_extents_match()
954 p2.ptr.offset < p1.ptr.offset + p1.crc.compressed_size))) in bch2_extents_match()
974 (s64) p1.ptr.offset + p1.crc.offset - bkey_start_offset(k1.k) == in bch2_extent_has_ptr()
975 (s64) p2.ptr.offset + p2.crc.offset - bkey_start_offset(k2.k)) in bch2_extent_has_ptr()
1111 void bch2_extent_crc_unpacked_to_text(struct printbuf *out, struct bch_extent_crc_unpacked *crc) in bch2_extent_crc_unpacked_to_text() argument
1113 prt_printf(out, "crc: c_size %u size %u offset %u nonce %u csum ", in bch2_extent_crc_unpacked_to_text()
1114 crc->compressed_size, in bch2_extent_crc_unpacked_to_text()
1115 crc->uncompressed_size, in bch2_extent_crc_unpacked_to_text()
1116 crc->offset, crc->nonce); in bch2_extent_crc_unpacked_to_text()
1117 bch2_prt_csum_type(out, crc->csum_type); in bch2_extent_crc_unpacked_to_text()
1118 prt_printf(out, " %0llx:%0llx ", crc->csum.hi, crc->csum.lo); in bch2_extent_crc_unpacked_to_text()
1120 bch2_prt_compression_type(out, crc->compression_type); in bch2_extent_crc_unpacked_to_text()
1145 struct bch_extent_crc_unpacked crc = in bch2_bkey_ptrs_to_text() local
1148 bch2_extent_crc_unpacked_to_text(out, &crc); in bch2_bkey_ptrs_to_text()
1228 struct bch_extent_crc_unpacked crc; in bch2_bkey_ptrs_validate() local
1271 crc = bch2_extent_crc_unpack(k.k, entry_to_crc(entry)); in bch2_bkey_ptrs_validate()
1273 bkey_fsck_err_on(crc.offset + crc.live_size > crc.uncompressed_size, in bch2_bkey_ptrs_validate()
1276 bkey_fsck_err_on(!bch2_checksum_type_valid(c, crc.csum_type), in bch2_bkey_ptrs_validate()
1279 bkey_fsck_err_on(crc.compression_type >= BCH_COMPRESSION_TYPE_NR, in bch2_bkey_ptrs_validate()
1283 if (bch2_csum_type_is_encryption(crc.csum_type)) { in bch2_bkey_ptrs_validate()
1285 nonce = crc.offset + crc.nonce; in bch2_bkey_ptrs_validate()
1286 else if (nonce != crc.offset + crc.nonce) in bch2_bkey_ptrs_validate()
1293 "redundant crc entry"); in bch2_bkey_ptrs_validate()
1296 bkey_fsck_err_on(crc_is_encoded(crc) && in bch2_bkey_ptrs_validate()
1297 (crc.uncompressed_size > c->opts.encoded_extent_max >> 9) && in bch2_bkey_ptrs_validate()
1302 size_ondisk = crc.compressed_size; in bch2_bkey_ptrs_validate()
1345 "redundant crc entry"); in bch2_bkey_ptrs_validate()
1419 if (p.crc.compression_type == BCH_COMPRESSION_TYPE_incompressible || in bch2_bkey_ptrs_need_rebalance()
1425 if (!p.ptr.cached && p.crc.compression_type != compression_type) in bch2_bkey_ptrs_need_rebalance()
1473 if (p.crc.compression_type == BCH_COMPRESSION_TYPE_incompressible || in __bch2_bkey_sectors_need_rebalance()
1479 if (!p.ptr.cached && p.crc.compression_type != compression_type) in __bch2_bkey_sectors_need_rebalance()
1480 sectors += p.crc.compressed_size; in __bch2_bkey_sectors_need_rebalance()
1487 sectors += p.crc.compressed_size; in __bch2_bkey_sectors_need_rebalance()