Lines Matching refs:ca

51 	struct bch_dev *ca;  in bch2_backpointer_to_text()  local
55 ca = bch2_dev_rcu_noerror(c, bp.k->p.inode); in bch2_backpointer_to_text()
56 if (ca) in bch2_backpointer_to_text()
57 bucket = bp_pos_to_bucket_and_offset(ca, bp.k->p, &bucket_offset); in bch2_backpointer_to_text()
60 if (ca) in bch2_backpointer_to_text()
493 struct bch_dev *ca = bch2_dev_get_ioref(c, dev, READ, in check_extent_checksum() local
495 if (!ca) in check_extent_checksum()
504 bio = bio_alloc(ca->disk_sb.bdev, buf_pages(data_buf, bytes), REQ_OP_READ, GFP_KERNEL); in check_extent_checksum()
531 enumerated_ref_put(&ca->io_ref[READ], in check_extent_checksum()
590 struct bch_dev *ca = bch2_dev_rcu_noerror(c, bp->k.p.inode); in check_bp_exists() local
591 if (ca) { in check_bp_exists()
595 dev_ptr_stale_rcu(ca, ptr)) { in check_bp_exists()
689 struct bch_dev *ca = bch2_dev_rcu_noerror(c, p.ptr.dev); in check_extent_to_backpointers() local
690 if (!ca) in check_extent_to_backpointers()
693 if (p.ptr.cached && dev_ptr_stale_rcu(ca, &p.ptr)) in check_extent_to_backpointers()
696 u64 b = PTR_BUCKET_NR(ca, &p.ptr); in check_extent_to_backpointers()
697 if (!bch2_bucket_bitmap_test(&ca->bucket_backpointer_mismatch, b)) in check_extent_to_backpointers()
700 empty = bch2_bucket_bitmap_test(&ca->bucket_backpointer_empty, b); in check_extent_to_backpointers()
898 struct bch_dev *ca = bch2_dev_bucket_tryget_noerror(trans->c, alloc_k.k->p); in check_bucket_backpointer_mismatch() local
899 if (!ca) in check_bucket_backpointer_mismatch()
906 bucket_pos_to_bp_start(ca, alloc_k.k->p), in check_bucket_backpointer_mismatch()
907 bucket_pos_to_bp_end(ca, alloc_k.k->p), 0, bp_k, ret) { in check_bucket_backpointer_mismatch()
955 ret = check_bucket_backpointers_to_extents(trans, ca, alloc_k.k->p) ?: in check_bucket_backpointer_mismatch()
964 ret = bch2_bucket_bitmap_set(ca, &ca->bucket_backpointer_mismatch, in check_bucket_backpointer_mismatch()
967 ? bch2_bucket_bitmap_set(ca, &ca->bucket_backpointer_empty, in check_bucket_backpointer_mismatch()
974 bch2_dev_put(ca); in check_bucket_backpointer_mismatch()
990 struct bch_dev *ca = bch2_dev_rcu_noerror(c, pos.inode); in backpointer_node_has_missing() local
991 if (!ca) in backpointer_node_has_missing()
994 struct bpos bucket = bp_pos_to_bucket(ca, pos); in backpointer_node_has_missing()
995 u64 next = ca->mi.nbuckets; in backpointer_node_has_missing()
997 unsigned long *bitmap = READ_ONCE(ca->bucket_backpointer_mismatch.buckets); in backpointer_node_has_missing()
1000 find_next_bit(bitmap, ca->mi.nbuckets, bucket.offset)); in backpointer_node_has_missing()
1003 if (bucket.offset == ca->mi.nbuckets) in backpointer_node_has_missing()
1006 ret = bpos_le(bucket_pos_to_bp_end(ca, bucket), k.k->p); in backpointer_node_has_missing()
1126 for_each_member_device(c, ca) { in bch2_check_extents_to_backpointers()
1127 nr_buckets += ca->mi.nbuckets; in bch2_check_extents_to_backpointers()
1128 nr_mismatches += ca->bucket_backpointer_mismatch.nr; in bch2_check_extents_to_backpointers()
1167 for_each_member_device(c, ca) { in bch2_check_extents_to_backpointers()
1168 bch2_bucket_bitmap_free(&ca->bucket_backpointer_mismatch); in bch2_check_extents_to_backpointers()
1169 bch2_bucket_bitmap_free(&ca->bucket_backpointer_empty); in bch2_check_extents_to_backpointers()
1199 struct bch_dev *ca, u64 bucket, in bch2_check_bucket_backpointer_mismatch() argument
1206 check_bucket_backpointer_pos_mismatch(trans, POS(ca->dev_idx, bucket), in bch2_check_bucket_backpointer_mismatch()
1211 u64 nr = ca->bucket_backpointer_mismatch.nr; in bch2_check_bucket_backpointer_mismatch()
1212 u64 allowed = copygc ? ca->mi.nbuckets >> 7 : 0; in bch2_check_bucket_backpointer_mismatch()
1215 __bch2_log_msg_start(ca->name, &buf); in bch2_check_bucket_backpointer_mismatch()
1218 bucket, nr, ca->mi.nbuckets); in bch2_check_bucket_backpointer_mismatch()
1260 struct bch_dev *ca, struct bpos bucket) in check_bucket_backpointers_to_extents() argument
1268 bucket_pos_to_bp_start(ca, bucket), in check_bucket_backpointers_to_extents()
1269 bucket_pos_to_bp_end(ca, bucket), in check_bucket_backpointers_to_extents()
1347 static int bch2_bucket_bitmap_set(struct bch_dev *ca, struct bucket_bitmap *b, u64 bit) in bch2_bucket_bitmap_set() argument
1351 b->buckets = kvcalloc(BITS_TO_LONGS(ca->mi.nbuckets), in bch2_bucket_bitmap_set()
1354 return bch_err_throw(ca->fs, ENOMEM_backpointer_mismatches_bitmap); in bch2_bucket_bitmap_set()
1363 int bch2_bucket_bitmap_resize(struct bch_dev *ca, struct bucket_bitmap *b, in bch2_bucket_bitmap_resize() argument
1373 return bch_err_throw(ca->fs, ENOMEM_backpointer_mismatches_bitmap); in bch2_bucket_bitmap_resize()