Lines Matching refs:ca
39 static inline void bch2_congested_acct(struct bch_dev *ca, u64 io_latency,
43 ca->io_latency[rw].quantiles.entries[QUANTILE_IDX(1)].m;
54 if (atomic_read(&ca->congested) < CONGESTED_MAX)
57 &ca->congested);
59 ca->congested_last = now;
60 } else if (atomic_read(&ca->congested) > 0) {
61 atomic_dec(&ca->congested);
65 void bch2_latency_acct(struct bch_dev *ca, u64 submit_time, int rw)
67 atomic64_t *latency = &ca->cur_latency[rw];
89 bch2_congested_acct(ca, io_latency, now, rw);
91 __bch2_time_stats_update(&ca->io_latency[rw].stats, submit_time, now);
410 struct bch_dev *ca = nocow
432 n->have_ioref = ca != NULL;
437 n->nocow_bucket = PTR_BUCKET_NR(ca, ptr);
441 this_cpu_add(ca->io_done->sectors[WRITE][type],
444 bio_set_dev(&n->bio, ca->disk_sb.bdev);
652 struct bch_dev *ca = wbio->have_ioref
656 if (bch2_dev_inum_io_err_on(bio->bi_status, ca, BCH_MEMBER_ERROR_write,
667 POS(ca->dev_idx, wbio->nocow_bucket),
673 bch2_latency_acct(ca, wbio->submit_time, WRITE);
674 percpu_ref_put(&ca->io_ref);
1268 struct bch_dev *ca = bch2_dev_get_ioref(c, ptr->dev, WRITE);
1269 if (unlikely(!ca))
1272 struct bpos b = PTR_BUCKET_POS(ca, ptr);
1295 struct bch_dev *ca = bch2_dev_have_ref(c, i->b.inode);
1302 bool stale = gen_after(*bucket_gen(ca, i->b.offset), i->gen);