Lines Matching refs:op

117 	struct bch_fs *c = u->op.c;  in trace_io_move_finish2()
144 struct bch_fs *c = m->op.c; in trace_io_move_fail2()
173 bch2_data_update_opts_to_text(&buf, c, &m->op.opts, &m->data_opts); in trace_io_move_fail2()
198 struct bch_fs *c = m->op.c; in trace_data_update2()
217 struct bch_fs *c = m->op.c; in trace_io_move_created_rebalance2()
220 bch2_data_update_opts_to_text(&buf, c, &m->op.opts, &m->data_opts); in trace_io_move_created_rebalance2()
240 struct bch_fs *c = m->op.c; in data_update_invalid_bkey()
245 prt_printf(&buf, "\nop.nonce: %u", m->op.nonce); in data_update_invalid_bkey()
263 struct bch_write_op *op) in __bch2_data_update_index_update() argument
265 struct bch_fs *c = op->c; in __bch2_data_update_index_update()
267 struct data_update *m = container_of(op, struct data_update, op); in __bch2_data_update_index_update()
271 bkey_start_pos(&bch2_keylist_front(&op->insert_keys)->k), in __bch2_data_update_index_update()
296 new = bkey_i_to_extent(bch2_keylist_front(&op->insert_keys)); in __bch2_data_update_index_update()
319 bkey_copy(&new->k_i, bch2_keylist_front(&op->insert_keys)); in __bch2_data_update_index_update()
340 bch2_extent_ptr_set_cached(c, &m->op.opts, in __bch2_data_update_index_update()
349 bch2_bkey_durability(c, k) >= m->op.opts.data_replicas) { in __bch2_data_update_index_update()
386 durability - ptr_durability >= m->op.opts.data_replicas) { in __bch2_data_update_index_update()
389 bch2_extent_ptr_set_cached(c, &m->op.opts, in __bch2_data_update_index_update()
401 bch2_extent_normalize_by_opts(c, &m->op.opts, bkey_i_to_s(insert)); in __bch2_data_update_index_update()
410 if (disk_sectors_delta > (s64) op->res.sectors) { in __bch2_data_update_index_update()
411 ret = bch2_disk_reservation_add(c, &op->res, in __bch2_data_update_index_update()
412 disk_sectors_delta - op->res.sectors, in __bch2_data_update_index_update()
443 bch2_bkey_set_needs_rebalance(c, &op->opts, insert) ?: in __bch2_data_update_index_update()
456 ret = bch2_trans_commit(trans, &op->res, in __bch2_data_update_index_update()
475 while (bkey_ge(iter.pos, bch2_keylist_front(&op->insert_keys)->k.p)) { in __bch2_data_update_index_update()
476 bch2_keylist_pop_front(&op->insert_keys); in __bch2_data_update_index_update()
477 if (bch2_keylist_empty(&op->insert_keys)) in __bch2_data_update_index_update()
500 int bch2_data_update_index_update(struct bch_write_op *op) in bch2_data_update_index_update() argument
502 return bch2_trans_run(op->c, __bch2_data_update_index_update(trans, op)); in bch2_data_update_index_update()
510 BUG_ON(!m->op.wbio.bio.bi_vcnt); in bch2_data_update_read_done()
512 m->op.crc = m->rbio.pick.crc; in bch2_data_update_read_done()
513 m->op.wbio.bio.bi_iter.bi_size = m->op.crc.compressed_size << 9; in bch2_data_update_read_done()
515 this_cpu_add(m->op.c->counters[BCH_COUNTER_io_move_write], m->k.k->k.size); in bch2_data_update_read_done()
517 closure_call(&m->op.cl, bch2_write, NULL, NULL); in bch2_data_update_read_done()
522 struct bch_fs *c = update->op.c; in bch2_data_update_exit()
525 bch2_bio_free_pages_pool(c, &update->op.wbio.bio); in bch2_data_update_exit()
532 bch2_disk_reservation_put(c, &update->op.res); in bch2_data_update_exit()
540 struct bch_fs *c = update->op.c; in bch2_update_unwritten_extent()
549 bch2_keylist_init(&update->op.insert_keys, update->op.inline_keys); in bch2_update_unwritten_extent()
551 while (bpos_lt(update->op.pos, update->k.k->k.p)) { in bch2_update_unwritten_extent()
553 update->op.pos.offset; in bch2_update_unwritten_extent()
557 bch2_trans_iter_init(trans, &iter, update->btree_id, update->op.pos, in bch2_update_unwritten_extent()
568 e = bkey_extent_init(update->op.insert_keys.top); in bch2_update_unwritten_extent()
569 e->k.p = update->op.pos; in bch2_update_unwritten_extent()
572 update->op.target, in bch2_update_unwritten_extent()
574 update->op.write_point, in bch2_update_unwritten_extent()
575 &update->op.devs_have, in bch2_update_unwritten_extent()
576 update->op.nr_replicas, in bch2_update_unwritten_extent()
577 update->op.nr_replicas, in bch2_update_unwritten_extent()
578 update->op.watermark, in bch2_update_unwritten_extent()
595 bch2_open_bucket_get(c, wp, &update->op.open_buckets); in bch2_update_unwritten_extent()
599 update->op.pos.offset += sectors; in bch2_update_unwritten_extent()
603 bch2_keylist_push(&update->op.insert_keys); in bch2_update_unwritten_extent()
605 ret = __bch2_data_update_index_update(trans, &update->op); in bch2_update_unwritten_extent()
607 bch2_open_buckets_put(c, &update->op.open_buckets); in bch2_update_unwritten_extent()
661 bch2_data_update_opts_to_text(out, m->op.c, &m->op.opts, &m->data_opts); in bch2_data_update_to_text()
665 bch2_bkey_val_to_text(out, m->op.c, bkey_i_to_s_c(m->k.k)); in bch2_data_update_to_text()
670 bch2_bkey_val_to_text(out, m->op.c, bkey_i_to_s_c(m->k.k)); in bch2_data_update_inflight_to_text()
673 bch2_data_update_opts_to_text(out, m->op.c, &m->op.opts, &m->data_opts); in bch2_data_update_inflight_to_text()
682 bch2_write_op_to_text(out, &m->op); in bch2_data_update_inflight_to_text()
741 bio_init(&m->op.wbio.bio, NULL, m->bvecs, nr_vecs, 0); in __bch2_data_update_bios_init()
743 if (bch2_bio_alloc_pages(&m->op.wbio.bio, buf_bytes, GFP_KERNEL)) { in __bch2_data_update_bios_init()
753 m->op.wbio.bio.bi_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0); in __bch2_data_update_bios_init()
774 if ((m->op.flags & BCH_WRITE_alloc_nowait) && in can_write_extent()
775 unlikely(c->open_buckets_nr_free <= bch2_open_buckets_reserved(m->op.watermark))) in can_write_extent()
778 unsigned target = m->op.flags & BCH_WRITE_only_specified_devs in can_write_extent()
779 ? m->op.target in can_write_extent()
783 darray_for_each(m->op.devs_have, i) in can_write_extent()
797 if (!dev_buckets_free(ca, usage, m->op.watermark)) in can_write_extent()
801 if (nr_replicas >= m->op.nr_replicas) in can_write_extent()
807 if (nr_replicas < m->op.nr_replicas) in can_write_extent()
849 bch2_write_op_init(&m->op, c, *io_opts); in bch2_data_update_init()
850 m->op.pos = bkey_start_pos(k.k); in bch2_data_update_init()
851 m->op.version = k.k->bversion; in bch2_data_update_init()
852 m->op.target = data_opts.target; in bch2_data_update_init()
853 m->op.write_point = wp; in bch2_data_update_init()
854 m->op.nr_replicas = 0; in bch2_data_update_init()
855 m->op.flags |= BCH_WRITE_pages_stable| in bch2_data_update_init()
860 m->op.compression_opt = io_opts->background_compression; in bch2_data_update_init()
861 m->op.watermark = m->data_opts.btree_insert_flags & BCH_WATERMARK_MASK; in bch2_data_update_init()
880 m->op.nr_replicas += bch2_extent_ptr_desired_durability(c, &p); in bch2_data_update_init()
883 bch2_dev_list_add_dev(&m->op.devs_have, p.ptr.dev); in bch2_data_update_init()
894 m->op.nonce = p.crc.nonce + p.crc.offset; in bch2_data_update_init()
895 m->op.csum_type = p.crc.csum_type; in bch2_data_update_init()
899 m->op.incompressible = true; in bch2_data_update_init()
917 m->op.nr_replicas = min(durability_removing, durability_required) + in bch2_data_update_init()
926 m->op.nr_replicas = max((unsigned) m->op.nr_replicas, 1); in bch2_data_update_init()
928 m->op.nr_replicas_required = m->op.nr_replicas; in bch2_data_update_init()
935 if (!m->op.nr_replicas) { in bch2_data_update_init()
964 ret = bch2_disk_reservation_add(c, &m->op.res, reserve_sectors, in bch2_data_update_init()
1002 bch2_disk_reservation_put(c, &m->op.res); in bch2_data_update_init()