Lines Matching refs:ca
106 struct bch_dev *ca; member
188 struct bch_dev *ca, in __mark_stripe_bucket() argument
265 ret = bch2_bucket_ref_update(trans, ca, s.s_c, ptr, sectors, data_type, in __mark_stripe_bucket()
295 struct bch_dev *ca = bch2_dev_tryget(c, ptr->dev); in mark_stripe_bucket() local
296 if (unlikely(!ca)) { in mark_stripe_bucket()
302 struct bpos bucket = PTR_BUCKET_POS(ca, ptr); in mark_stripe_bucket()
316 __mark_stripe_bucket(trans, ca, s, ptr_idx, deleting, bucket, &a->v, flags) ?: in mark_stripe_bucket()
324 struct bucket *g = gc_bucket(ca, bucket.offset); in mark_stripe_bucket()
334 ret = __mark_stripe_bucket(trans, ca, s, ptr_idx, deleting, bucket, &new, flags); in mark_stripe_bucket()
339 ret = bch2_alloc_key_to_dev_counters(trans, ca, &old, &new, flags); in mark_stripe_bucket()
342 bch2_dev_put(ca); in mark_stripe_bucket()
633 struct bch_dev *ca = bch2_dev_tryget(c, v->ptrs[i].dev); in ec_validate_checksums() local
634 if (ca) { in ec_validate_checksums()
641 bch_err_ratelimited(ca, "%s", err.buf); in ec_validate_checksums()
644 bch2_io_error(ca, BCH_MEMBER_ERROR_checksum); in ec_validate_checksums()
702 struct bch_dev *ca = ec_bio->ca; in ec_block_endio() local
709 bch2_account_io_completion(ca, bio_data_dir(bio), in ec_block_endio()
713 bch_err_dev_ratelimited(ca, "erasure coding %s error: %s", in ec_block_endio()
719 int stale = dev_ptr_stale(ca, ptr); in ec_block_endio()
721 bch_err_ratelimited(ca->fs, in ec_block_endio()
729 enumerated_ref_put(&ca->io_ref[rw], ref); in ec_block_endio()
747 struct bch_dev *ca = bch2_dev_get_ioref(c, ptr->dev, rw, ref); in ec_block_io() local
748 if (!ca) { in ec_block_io()
753 int stale = dev_ptr_stale(ca, ptr); in ec_block_io()
764 this_cpu_add(ca->io_done->sectors[rw][data_type], buf->size); in ec_block_io()
773 ec_bio = container_of(bio_alloc_bioset(ca->disk_sb.bdev, in ec_block_io()
780 ec_bio->ca = ca; in ec_block_io()
793 enumerated_ref_get(&ca->io_ref[rw], ref); in ec_block_io()
800 enumerated_ref_put(&ca->io_ref[rw], ref); in ec_block_io()
1101 struct bch_dev *ca, in ec_stripe_update_extent() argument
1197 struct bch_dev *ca = bch2_dev_tryget(c, ptr.dev); in ec_stripe_update_bucket() local
1198 if (!ca) in ec_stripe_update_bucket()
1201 struct bpos bucket_pos = PTR_BUCKET_POS(ca, &ptr); in ec_stripe_update_bucket()
1208 bucket_pos_to_bp_start(ca, bucket_pos), in ec_stripe_update_bucket()
1209 bucket_pos_to_bp_end(ca, bucket_pos), 0, bp_k, in ec_stripe_update_bucket()
1213 if (bkey_ge(bp_k.k->p, bucket_pos_to_bp(ca, bpos_nosnap_successor(bucket_pos), 0))) in ec_stripe_update_bucket()
1223 ec_stripe_update_extent(trans, ca, bucket_pos, ptr.gen, s, in ec_stripe_update_bucket()
1228 bch2_dev_put(ca); in ec_stripe_update_bucket()
1257 struct bch_dev *ca = bch2_dev_get_ioref(c, ob->dev, WRITE, in zero_out_rest_of_ec_bucket() local
1259 if (!ca) { in zero_out_rest_of_ec_bucket()
1264 unsigned offset = ca->mi.bucket_size - ob->sectors_free; in zero_out_rest_of_ec_bucket()
1269 int ret = blkdev_issue_zeroout(ca->disk_sb.bdev, in zero_out_rest_of_ec_bucket()
1270 ob->bucket * ca->mi.bucket_size + offset, in zero_out_rest_of_ec_bucket()
1274 enumerated_ref_put(&ca->io_ref[WRITE], BCH_DEV_WRITE_REF_ec_bucket_zero); in zero_out_rest_of_ec_bucket()
1474 struct bch_dev *ca = ob_dev(c, ob); in bch2_writepoint_ec_buf() local
1475 unsigned offset = ca->mi.bucket_size - ob->sectors_free; in bch2_writepoint_ec_buf()
1497 for_each_member_device_rcu(c, ca, devs) in pick_blocksize()
1498 sizes[nr++] = ca->mi.bucket_size; in pick_blocksize()
1590 for_each_member_device_rcu(c, ca, &h->devs) in ec_stripe_head_devs_update()
1591 if (!ca->mi.durability) in ec_stripe_head_devs_update()
1592 __clear_bit(ca->dev_idx, h->devs.d); in ec_stripe_head_devs_update()
1598 for_each_member_device_rcu(c, ca, &h->devs) in ec_stripe_head_devs_update()
1599 if (ca->mi.bucket_size == h->blocksize) in ec_stripe_head_devs_update()
2151 struct bch_dev *ca = bch2_dev_rcu(c, ptr->dev); in bch2_invalidate_stripe_to_dev() local
2152 nr_good += ca && ca->mi.state != BCH_MEMBER_STATE_failed; in bch2_invalidate_stripe_to_dev()
2215 static void __bch2_ec_stop(struct bch_fs *c, struct bch_dev *ca) in __bch2_ec_stop() argument
2227 if (!ca) in __bch2_ec_stop()
2235 if (ob->dev == ca->dev_idx) in __bch2_ec_stop()
2247 void bch2_ec_stop_dev(struct bch_fs *c, struct bch_dev *ca) in bch2_ec_stop_dev() argument
2249 __bch2_ec_stop(c, ca); in bch2_ec_stop_dev()