Lines Matching full:crc
342 lp.crc = bch2_extent_crc_unpack(l.k, NULL); in bch2_extent_merge()
343 rp.crc = bch2_extent_crc_unpack(r.k, NULL); in bch2_extent_merge()
347 if (lp.ptr.offset + lp.crc.offset + lp.crc.live_size != in bch2_extent_merge()
348 rp.ptr.offset + rp.crc.offset || in bch2_extent_merge()
371 if (lp.crc.compression_type != rp.crc.compression_type || in bch2_extent_merge()
372 lp.crc.nonce != rp.crc.nonce) in bch2_extent_merge()
375 if (lp.crc.offset + lp.crc.live_size + rp.crc.live_size <= in bch2_extent_merge()
376 lp.crc.uncompressed_size) { in bch2_extent_merge()
377 /* can use left extent's crc entry */ in bch2_extent_merge()
378 } else if (lp.crc.live_size <= rp.crc.offset) { in bch2_extent_merge()
379 /* can use right extent's crc entry */ in bch2_extent_merge()
382 if (lp.crc.csum_type != rp.crc.csum_type || in bch2_extent_merge()
383 lp.crc.nonce != rp.crc.nonce || in bch2_extent_merge()
384 crc_is_compressed(lp.crc) || in bch2_extent_merge()
385 !bch2_checksum_mergeable(lp.crc.csum_type)) in bch2_extent_merge()
388 if (lp.crc.offset + lp.crc.live_size != lp.crc.compressed_size || in bch2_extent_merge()
389 rp.crc.offset) in bch2_extent_merge()
392 if (lp.crc.csum_type && in bch2_extent_merge()
393 lp.crc.uncompressed_size + in bch2_extent_merge()
394 rp.crc.uncompressed_size > (c->opts.encoded_extent_max >> 9)) in bch2_extent_merge()
436 /* can use left extent's crc entry */ in bch2_extent_merge()
438 /* can use right extent's crc entry */ in bch2_extent_merge()
532 struct bch_extent_crc_unpacked crc; in bch2_can_narrow_extent_crcs() local
538 bkey_for_each_crc(k.k, ptrs, crc, i) in bch2_can_narrow_extent_crcs()
539 if (can_narrow_crc(crc, n)) in bch2_can_narrow_extent_crcs()
582 if (can_narrow_crc(p.crc, n)) { in bch2_bkey_narrow_crcs()
584 p.ptr.offset += p.crc.offset; in bch2_bkey_narrow_crcs()
585 p.crc = n; in bch2_bkey_narrow_crcs()
638 union bch_extent_crc *crc = (void *) ptrs.end; in bch2_extent_crc_append() local
656 bch2_extent_crc_pack(crc, new, type); in bch2_extent_crc_append()
689 ret += !p.ptr.cached && !crc_is_compressed(p.crc); in bch2_bkey_nr_ptrs_fully_allocated()
703 if (!p.ptr.cached && crc_is_compressed(p.crc)) in bch2_bkey_sectors_compressed()
704 ret += p.crc.compressed_size; in bch2_bkey_sectors_compressed()
713 struct bch_extent_crc_unpacked crc; in bch2_bkey_is_incompressible() local
715 bkey_for_each_crc(k.k, ptrs, crc, entry) in bch2_bkey_is_incompressible()
716 if (crc.compression_type == BCH_COMPRESSION_TYPE_incompressible) in bch2_bkey_is_incompressible()
813 struct bch_extent_crc_unpacked crc = in bch2_extent_ptr_decoded_append() local
817 if (!bch2_crc_unpacked_cmp(crc, p->crc)) { in bch2_extent_ptr_decoded_append()
822 bkey_for_each_crc(&k->k, ptrs, crc, pos) in bch2_extent_ptr_decoded_append()
823 if (!bch2_crc_unpacked_cmp(crc, p->crc)) { in bch2_extent_ptr_decoded_append()
828 bch2_extent_crc_append(k, p->crc); in bch2_extent_ptr_decoded_append()
979 (s64) p.ptr.offset + p.crc.offset - bkey_start_offset(k.k) == in bch2_bkey_matches_ptr()
1014 (s64) p1.ptr.offset + p1.crc.offset - bkey_start_offset(k1.k) == in bch2_extents_match()
1015 (s64) p2.ptr.offset + p2.crc.offset - bkey_start_offset(k2.k) && in bch2_extents_match()
1027 p1.ptr.offset < p2.ptr.offset + p2.crc.compressed_size) || in bch2_extents_match()
1029 p2.ptr.offset < p1.ptr.offset + p1.crc.compressed_size))) in bch2_extents_match()
1049 (s64) p1.ptr.offset + p1.crc.offset - bkey_start_offset(k1.k) == in bch2_extent_has_ptr()
1050 (s64) p2.ptr.offset + p2.crc.offset - bkey_start_offset(k2.k)) in bch2_extent_has_ptr()
1187 void bch2_extent_crc_unpacked_to_text(struct printbuf *out, struct bch_extent_crc_unpacked *crc) in bch2_extent_crc_unpacked_to_text() argument
1189 prt_printf(out, "crc: c_size %u size %u offset %u nonce %u csum ", in bch2_extent_crc_unpacked_to_text()
1190 crc->compressed_size, in bch2_extent_crc_unpacked_to_text()
1191 crc->uncompressed_size, in bch2_extent_crc_unpacked_to_text()
1192 crc->offset, crc->nonce); in bch2_extent_crc_unpacked_to_text()
1193 bch2_prt_csum_type(out, crc->csum_type); in bch2_extent_crc_unpacked_to_text()
1194 prt_printf(out, " %0llx:%0llx ", crc->csum.hi, crc->csum.lo); in bch2_extent_crc_unpacked_to_text()
1196 bch2_prt_compression_type(out, crc->compression_type); in bch2_extent_crc_unpacked_to_text()
1272 struct bch_extent_crc_unpacked crc = in bch2_bkey_ptrs_to_text() local
1275 bch2_extent_crc_unpacked_to_text(out, &crc); in bch2_bkey_ptrs_to_text()
1350 struct bch_extent_crc_unpacked crc; in bch2_bkey_ptrs_validate() local
1393 crc = bch2_extent_crc_unpack(k.k, entry_to_crc(entry)); in bch2_bkey_ptrs_validate()
1395 bkey_fsck_err_on(!bch2_checksum_type_valid(c, crc.csum_type), in bch2_bkey_ptrs_validate()
1398 bkey_fsck_err_on(crc.compression_type >= BCH_COMPRESSION_TYPE_NR, in bch2_bkey_ptrs_validate()
1402 bkey_fsck_err_on(crc.offset + crc.live_size > crc.uncompressed_size, in bch2_bkey_ptrs_validate()
1405 bkey_fsck_err_on(crc_is_encoded(crc) && in bch2_bkey_ptrs_validate()
1406 (crc.uncompressed_size > c->opts.encoded_extent_max >> 9) && in bch2_bkey_ptrs_validate()
1410 bkey_fsck_err_on(!crc_is_compressed(crc) && in bch2_bkey_ptrs_validate()
1411 crc.compressed_size != crc.uncompressed_size, in bch2_bkey_ptrs_validate()
1415 if (bch2_csum_type_is_encryption(crc.csum_type)) { in bch2_bkey_ptrs_validate()
1417 nonce = crc.offset + crc.nonce; in bch2_bkey_ptrs_validate()
1418 else if (nonce != crc.offset + crc.nonce) in bch2_bkey_ptrs_validate()
1425 "redundant crc entry"); in bch2_bkey_ptrs_validate()
1428 size_ondisk = crc.compressed_size; in bch2_bkey_ptrs_validate()
1476 "redundant crc entry"); in bch2_bkey_ptrs_validate()