23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CAS 55 #include "cas/cas_xc.h" 424 #define LAYOUT_IMASK_PTR(l) (&(l)->u.dl_desc.ld_imask) 425 #define CID_IMASK_PTR(cid) LAYOUT_IMASK_PTR(&(cid)->ci_layout) 453 uint64_t rec_pos,
int next);
570 ut_dom :
svc->rs_reqh_ctx->rc_beseg->bs_domain;
675 (in_nr == 0 || ikv !=
NULL) &&
677 *
out = fom0 = &
fom->cf_fom;
679 fom->cf_ikv_nr = in_nr;
686 &
fom->cf_lock_addb2);
688 &
fom->cf_meta_addb2);
690 &
fom->cf_ctidx_addb2);
692 &
fom->cf_dead_index_addb2);
694 &
fom->cf_del_lock_addb2);
725 out->u.ab_buf = *repbuf;
747 *
key =
fom->cf_ikv[rec_pos].ckv_key;
748 *
val =
fom->cf_ikv[rec_pos].ckv_val;
775 for (
i = 0;
i <
op->cg_rec.cr_nr &&
rc == 0;
i++) {
776 rec = &
op->cg_rec.cr_rec[
i];
821 ret =
key ?
NULL : &
op->cg_rec.cr_rec[opos].cr_val;
824 while (opos >=
op->cg_rec.cr_rec[
i].cr_rc) {
825 opos -=
op->cg_rec.cr_rec[
i].cr_rc;
829 rec = &
op->cg_rec.cr_rec[
i];
834 if (opos < kv->
cv_nr)
916 return op->cg_rec.cr_nr != 0 &&
op->cg_rec.cr_rec !=
NULL &&
925 bool payload_exceeded =
false;
936 return payload_exceeded;
949 bool key_send =
true;
951 if (opc ==
CO_CUR &&
fom->cf_curpos == 0) {
961 cid = &
fom->cf_in_cids[rec_pos];
970 fom->cf_startkey_excluded =
true;
1040 &((
struct m0_buf) { .b_nob =
rc }),
1067 &
buf.b_addr, &
buf.b_nob) ?:
1117 kv_stats_labels[
i][kv_io][j],
1118 fom->cf_kv_stats[
i][kv_io][j]);
1173 size_t ipos =
fom->cf_ipos;
1187 M0_ENTRY(
"fom %p phase %d op_flag=0x%x",
fom, phase,
op->cg_flags);
1257 fom->cf_op_checked =
true;
1295 }
else if (
rc == -ENOENT && opc ==
CO_PUT &&
1334 if (
fom->cf_thrall_rc == 0 ||
fom->cf_thrall_rc == -EEXIST)
1356 if (
fom->cf_ipos ==
op->cg_rec.cr_nr) {
1381 is_index_drop ? &
fom->cf_meta :
1399 rep->cgr_rep.cr_rec[
i].cr_rc == 0));
1407 for (
i = 0;
i <
op->cg_rec.cr_nr;
i++)
1452 fom->cf_ipos = ++ipos;
1454 if (ipos ==
op->cg_rec.cr_nr ||
1456 fom->cf_opos ==
rep->cgr_rep.cr_nr) {
1533 fom->cf_moved_ctgs[ipos] =
fom->cf_ctg;
1554 fom->cf_moved_ctgs[ipos] =
NULL;
1565 &
fom->cf_in_cids[ipos].ci_fid,
1575 fom->cf_ipos = ++ipos;
1593 if (ipos ==
op->cg_rec.cr_nr) {
1600 &
fom->cf_dead_index);
1602 }
else if (
fom->cf_moved_ctgs[ipos] !=
NULL) {
1645 if (rec->
cr_rc == 0) {
1647 if (rec->
cr_rc == 0) {
1652 if (rec->
cr_rc == 0)
1709 return M0_RC(result);
1722 for (
i = 0;
i <
op->cg_rec.cr_nr;
i++) {
1733 for (
i = 0;
i <
fom->cf_in_cids_nr;
i++)
1756 static uint64_t loc = 0;
1789 *state_out = sdev->pd_state;
1824 pm = &
pver->pv_mach;
1889 if (
rc == 0 && is_meta &&
fom->cf_ikv_nr != 0) {
1893 if (is_index_drop) {
1902 if (
fom->cf_moved_ctgs ==
NULL)
1930 result = gotkey && !gotval && rec->
cr_rc == 0;
1933 result = gotkey && (gotval == !meta) && rec->
cr_rc == 0;
1936 result = gotkey && !gotval;
1939 result = !gotval == (((int64_t)rec->
cr_rc) < 0 || meta);
1950 if (meta && gotkey && result) {
1973 (
imask->im_nr == 0) &&
1983 fom->cf_in_cids[rec_pos] = cid;
1984 fom->cf_in_cids_nr++;
1987 return M0_RC(result);
2007 return op->cg_rec.cr_nr;
2015 nr =
op->cg_rec.cr_nr;
2017 nr = m0_reduce(
i,
nr, 0, +
op->cg_rec.cr_rec[
i].cr_rc);
2047 if (
src->b_nob >= cutoff) {
2052 memcpy(
dst->b_addr,
src->b_addr,
src->b_nob);
2056 return M0_RC(result);
2068 return inbuf->
b_nob +
sizeof(uint64_t);
2090 cid = &
fom->cf_in_cids[rec_pos];
2124 return &
op->cg_rec.cr_rec[idx];
2130 return &
rep->cgr_rep.cr_rec[idx];
2155 uint64_t rec_pos,
int next)
2170 cid = &
fom->cf_in_cids[rec_pos];
2191 if (ctg_op->
co_rc == 0) {
2221 if (
fom->cf_curpos == 0) {
2247 bool is_needed =
false;
2252 cid = &
fom->cf_in_cids[rec_pos];
2292 bool free_called =
false;
2310 if (
rc != 0 || !free_called)
2353 bool ctg_op_ok =
true;
2376 if (ctg_op_ok ==
true) {
2442 if (
rc == 0 && ctg_rc == 0)
2443 rc =
fom->cf_startkey_excluded ?
2444 fom->cf_curpos - 1 :
fom->cf_curpos;
2447 (
fom->cf_startkey_excluded &&
2448 (
fom->cf_curpos < rec->
cr_rc + 1)))) {
2458 fom->cf_startkey_excluded =
false;
2484 return rec_out->
cr_rc;
2499 &
buf.b_addr, &
buf.b_nob);
2502 at_buf->
u.ab_buf =
buf;
2526 op->cg_rec.cr_nr = 1;
2527 op->cg_rec.cr_rec = rec;
2555 rc =
rep->cgr_rep.cr_rec[0].cr_rc;
2562 const struct m0_fom *crow_fom0)
2624 const struct m0_fom *fom0 = &
fom->cf_fom;
2631 fom->cf_ipos <=
op->cg_rec.cr_nr)) &&
2641 for (
i = 0;
i <
op->cg_rec.cr_nr;
i++) {
2662 .
sd_name =
"cas-op-check-prepare",
2666 .sd_name =
"cas-op-check",
2674 .sd_name =
"meta-lock",
2678 .sd_name =
"meta-lookup",
2682 .sd_name =
"meta-lookup-done",
2687 .sd_name =
"ctg-crow-done",
2695 .sd_name =
"ctidx_lock",
2699 .sd_name =
"load-key",
2703 .sd_name =
"load-value",
2707 .sd_name =
"load-done",
2716 .sd_name =
"txn-opened",
2720 .sd_name =
"meta-unlock",
2737 .sd_name =
"ctidx-im-range-alloc",
2741 .sd_name =
"ctidx-insert",
2746 .sd_name =
"ctidx-lookup",
2750 .sd_name =
"ctidx-im-range-free",
2754 .sd_name =
"ctidx-delete",
2765 .sd_name =
"prep-send",
2769 .sd_name =
"send-key",
2773 .sd_name =
"key-sent",
2777 .sd_name =
"send-val",
2781 .sd_name =
"val-sent",
2785 .sd_name =
"dead-index-lock",
2789 .sd_name =
"insert-dead-index",
2793 .sd_name =
"detele-from-meta",
2798 .sd_name =
"index-drop-loop",
2803 .sd_name =
"index-drop-lock-loop",
2808 .sd_name =
"index-drop-locked",
2812 .sd_name =
"index-drop-start-gc",
2931 .rst_typecode = M0_CST_CAS
2934 #undef M0_TRACE_SUBSYSTEM static int cas_key_send(struct cas_fom *fom, const struct m0_cas_op *op, enum m0_cas_opcode opc, const struct m0_cas_rep *rep, enum cas_fom_phase next_phase)
M0_INTERNAL int m0_reqh_service_state_get(const struct m0_reqh_service *s)
struct m0_poolmach_state * pm_state
static uint64_t cas_in_nr(const struct m0_fop *fop)
M0_INTERNAL void m0_long_lock_link_init(struct m0_long_lock_link *link, struct m0_fom *fom, struct m0_long_lock_addb2 *addb2)
static void cas_ctg_crow_done_cb(struct m0_fom_thralldom *thrall, struct m0_fom *serf)
M0_INTERNAL void m0_ctg_ctidx_insert_credits(struct m0_cas_id *cid, struct m0_be_tx_credit *accum)
M0_INTERNAL void m0_ctg_delete_credit(struct m0_cas_ctg *ctg, m0_bcount_t knob, m0_bcount_t vnob, struct m0_be_tx_credit *accum)
struct m0_rpc_at_buf cr_val
struct m0_dtm0_tx_desc cg_txd
M0_INTERNAL void m0_sm_conf_init(struct m0_sm_conf *conf)
#define M0_ALLOC_ARR(arr, nr)
static int cas_op_check(struct m0_cas_op *op, struct cas_fom *fom, bool is_index_drop)
M0_INTERNAL int m0_ctg_meta_insert(struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
#define M0_BUF_INIT_PTR_CONST(p)
static int cas_place(struct m0_buf *dst, struct m0_buf *src, m0_bcount_t cutoff)
M0_INTERNAL int m0_ctg_dead_index_insert(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, int next_phase)
struct m0_rpc_at_buf ck_key
int const char const void size_t int flags
struct m0_dtm0_tx_desc cg_txd
static int cas_prep_send(struct cas_fom *fom, enum m0_cas_opcode opc, enum m0_cas_type ct)
#define M0_FOM_LONG_LOCK_RETURN(rc)
struct m0_long_lock_addb2 cf_dead_index_addb2
M0_INTERNAL struct m0_dtm0_service * m0_dtm0_service_find(const struct m0_reqh *reqh)
M0_INTERNAL int m0_ctg_delete(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, const struct m0_buf *key, int next_phase)
struct m0_long_lock_addb2 cf_del_lock_addb2
M0_INTERNAL int m0_ctg_lookup_delete(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, const struct m0_buf *key, struct m0_buf *val, int flags, int next_phase)
struct m0_reqh_service c_service
uint64_t cf_kv_stats[STATS_KV_NR][STATS_KV_IO_NR][STATS_NR]
M0_INTERNAL struct m0_pool_version * m0_pool_version_find(struct m0_pools_common *pc, const struct m0_fid *id)
M0_INTERNAL void m0_ctg_lookup_result(struct m0_ctg_op *ctg_op, struct m0_buf *buf)
int(* fo_tick)(struct m0_fom *fom)
M0_INTERNAL bool m0_buf_eq(const struct m0_buf *x, const struct m0_buf *y)
M0_INTERNAL void m0_cas_svc_init(void)
M0_INTERNAL int m0_ctg_gc_wait(struct m0_ctg_op *ctg_op, int next_phase)
M0_INTERNAL struct m0_long_lock * m0_ctg_lock(struct m0_cas_ctg *ctg)
M0_INTERNAL void m0_ctg_store_fini(void)
M0_INTERNAL void m0_ctg_mem_place_get(struct m0_ctg_op *ctg_op, struct m0_buf *buf)
M0_INTERNAL void m0_fop_init(struct m0_fop *fop, struct m0_fop_type *fopt, void *data, void(*fop_release)(struct m0_ref *))
M0_INTERNAL int m0_ctg_meta_cursor_next(struct m0_ctg_op *ctg_op, int next_phase)
#define M0_LOG(level,...)
M0_INTERNAL void m0_rpc_at_init(struct m0_rpc_at_buf *ab)
static void cas_fom_success(struct cas_fom *fom, enum m0_cas_opcode opc)
M0_INTERNAL bool m0_rpc_at_is_set(const struct m0_rpc_at_buf *ab)
static void cas_fom_cleanup(struct cas_fom *fom, bool ctg_op_fini)
static int cas_dtm0_logrec_add(struct m0_fom *fom0, enum m0_dtm0_tx_pa_state state)
static void cas_service_fini(struct m0_reqh_service *service)
struct m0_cas_id * cf_in_cids
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
struct m0_long_lock_link cf_del_lock
M0_INTERNAL void m0_cas_id_fini(struct m0_cas_id *cid)
struct m0_long_lock_link cf_dead_index
M0_INTERNAL int m0_ctg_lookup(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, const struct m0_buf *key, int next_phase)
static bool cas_fom_invariant(const struct cas_fom *fom)
M0_INTERNAL const struct m0_fid m0_cas_meta_fid
M0_INTERNAL void m0_cas__ut_svc_be_set(struct m0_reqh_service *svc, struct m0_be_domain *dom)
struct m0_dix_layout ci_layout
static bool cas_max_reply_payload_exceeded(struct cas_fom *fom)
M0_INTERNAL const struct m0_fid_type m0_cas_index_fid_type
static enum m0_cas_type cas_type(const struct m0_fom *fom)
static void cas_update_kv_stats(struct cas_fom *fom, const struct m0_rpc_at_buf *ab, m0_bcount_t nob, enum stats_kv kv, enum stats_kv_io kv_io)
void * m0_fop_data(const struct m0_fop *fop)
static struct m0_cas_rec * cas_at(struct m0_cas_op *op, int idx)
M0_INTERNAL void m0_sm_conf_trans_extend(const struct m0_sm_conf *base, struct m0_sm_conf *sub)
M0_INTERNAL void m0_sm_conf_extend(const struct m0_sm_state_descr *base, struct m0_sm_state_descr *sub, uint32_t nr)
struct m0_cas_recv cgr_rep
static struct m0_addb2_mach * mach
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
M0_INTERNAL int m0_pageshift_get(void)
static void cas_addb2_fom_to_crow_fom(const struct m0_fom *fom0, const struct m0_fom *crow_fom0)
M0_INTERNAL bool m0_dtm0_tx_desc__invariant(const struct m0_dtm0_tx_desc *td)
M0_INTERNAL int m0_cas_fom_spawn(struct m0_fom *lead, struct m0_fom_thralldom *thrall, struct m0_fop *cas_fop, void(*on_fom_complete)(struct m0_fom_thralldom *, struct m0_fom *))
M0_INTERNAL struct m0_cas_ctg * m0_ctg_dead_index(void)
M0_INTERNAL int m0_rpc_at_load(struct m0_rpc_at_buf *ab, struct m0_fom *fom, int next_phase)
M0_INTERNAL int m0_ctg_cursor_get(struct m0_ctg_op *ctg_op, const struct m0_buf *key, int next_phase)
M0_ADDB2_ADD(M0_AVI_FS_CREATE, new_fid.f_container, new_fid.f_key, mode, rc)
struct m0_fom_thralldom cf_thrall
static void cas_at_fini(struct m0_rpc_at_buf *ab)
static void cas_fom_addb2_descr(struct m0_fom *fom)
#define LAYOUT_IMASK_PTR(l)
const struct m0_sm_conf m0_generic_conf
struct m0_fop_getxattr_rep * rep
M0_INTERNAL void m0_ctg_insert_credit(struct m0_cas_ctg *ctg, m0_bcount_t knob, m0_bcount_t vnob, struct m0_be_tx_credit *accum)
int m0_reqh_service_type_register(struct m0_reqh_service_type *rstype)
static struct m0_be_tx * m0_fom_tx(struct m0_fom *fom)
static bool cas_is_ro(enum m0_cas_opcode opc)
static const struct m0_fid * cas_fid(const struct m0_fom *fom)
M0_INTERNAL int m0_dtm0_on_committed(struct m0_fom *fom, const struct m0_dtm0_tid *id)
static struct m0_pools_common pc
M0_INTERNAL int m0_rpc_at_reply(struct m0_rpc_at_buf *in, struct m0_rpc_at_buf *out, struct m0_buf *repbuf, struct m0_fom *fom, int next_phase)
struct m0_fom_type ft_fom_type
struct m0_rpc_at_buf cr_val
struct m0_pooldev * pst_devices_array
M0_INTERNAL bool m0_ctg_cursor_is_initialised(struct m0_ctg_op *ctg_op)
struct m0_be_dtm0_log * dos_log
M0_INTERNAL void m0_cas_gc_init(void)
struct m0_dtm0_tid dtd_id
M0_INTERNAL int m0_ctg_mem_free(struct m0_ctg_op *ctg_op, void *area, int next_phase)
M0_INTERNAL int m0_pagesize_get(void)
struct m0_cas_rec * cr_rec
static int cas_buf_cid_decode(struct m0_buf *enc_buf, struct m0_cas_id *cid)
M0_INTERNAL int m0_ctg_insert(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, const struct m0_buf *key, const struct m0_buf *val, int next_phase)
struct m0_rpc_at_buf ck_val
M0_INTERNAL int m0_ctg_cursor_next(struct m0_ctg_op *ctg_op, int next_phase)
struct m0_rpc_at_buf cr_key
M0_INTERNAL int m0_ctg_meta_lookup(struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
void m0_fom_init(struct m0_fom *fom, const struct m0_fom_type *fom_type, const struct m0_fom_ops *ops, struct m0_fop *fop, struct m0_fop *reply, struct m0_reqh *reqh)
M0_INTERNAL bool m0_long_write_lock(struct m0_long_lock *lk, struct m0_long_lock_link *link, int next_phase)
M0_INTERNAL void m0_ctg_cursor_fini(struct m0_ctg_op *ctg_op)
void m0_fop_rpc_machine_set(struct m0_fop *fop, struct m0_rpc_machine *mach)
struct m0_fop_type * f_type
M0_INTERNAL bool m0_long_lock(struct m0_long_lock *lock, bool write, struct m0_long_lock_link *link, int next_phase)
static m0_bcount_t cas_kv_nob(const struct m0_buf *inbuf)
struct m0_rpc_machine * m0_fop_rpc_machine(const struct m0_fop *fop)
static const struct m0_reqh_service_type_ops cas_service_type_ops
static int cas_service_type_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *st)
return M0_ERR(-EOPNOTSUPP)
m0_bcount_t rm_bulk_cutoff
struct m0_long_lock_link cf_ctidx
M0_INTERNAL bool m0_dix_layout_eq(const struct m0_dix_layout *layout1, const struct m0_dix_layout *layout2)
static int cas_ctidx_mem_free(struct cas_fom *fom, int next)
M0_INTERNAL void m0_ctg_cursor_put(struct m0_ctg_op *ctg_op)
#define M0_AMB(obj, ptr, field)
struct m0_fom_thralldom thrall
M0_INTERNAL int m0_ctg_mem_place(struct m0_ctg_op *ctg_op, const struct m0_buf *buf, int next_phase)
static const struct socktype stype[]
#define CTG_OP_COMBINE(opc, ct)
M0_INTERNAL struct m0_cas_ctg * m0_ctg_meta(void)
int m0_fom_tick_generic(struct m0_fom *fom)
static int cas_ctg_crow_fop_create(const struct m0_cas_id *cid, struct m0_fop **out)
M0_INTERNAL void m0_long_unlock(struct m0_long_lock *lock, struct m0_long_lock_link *link)
void m0_fom_fini(struct m0_fom *fom)
M0_INTERNAL void m0_cas_svc_fini(void)
struct m0_long_lock_addb2 cf_ctidx_addb2
struct m0_cas_ctg * cf_ctg
struct m0_be_domain * c_be_domain
void m0_fom_phase_move(struct m0_fom *fom, int32_t rc, int phase)
static int op_sync_wait(struct m0_fom *fom)
M0_INTERNAL void m0_long_lock_link_fini(struct m0_long_lock_link *link)
M0_INTERNAL bool cas_in_ut(void)
struct m0_fid rs_service_fid
M0_INTERNAL void m0_be_tx_credit_add(struct m0_be_tx_credit *c0, const struct m0_be_tx_credit *c1)
M0_INTERNAL bool m0_rpc_item_max_payload_exceeded(struct m0_rpc_item *item, struct m0_rpc_session *session)
static int cas_ctidx_delete(struct cas_fom *fom, const struct m0_cas_id *in_cid, int next)
static struct m0_rpc_at_buf * cas_out_complementary(enum m0_cas_opcode opc, const struct m0_cas_op *op, bool key, size_t opos)
M0_INTERNAL int m0_ctg_store_init(struct m0_be_domain *dom)
struct m0_tl rh_rpc_machines
M0_BASSERT(M0_CAS_GET_FOP_OPCODE==CO_GET+M0_CAS_GET_FOP_OPCODE)
M0_INTERNAL void m0_fom_enthrall(struct m0_fom *leader, struct m0_fom *serf, struct m0_fom_thralldom *thrall, void(*end)(struct m0_fom_thralldom *thrall, struct m0_fom *serf))
static struct m0_stob_domain * dom
M0_INTERNAL void m0_ctg_mark_deleted_credit(struct m0_be_tx_credit *accum)
static int cas_ctidx_insert(struct cas_fom *fom, const struct m0_cas_id *in_cid, int next)
M0_INTERNAL int m0_xcode_obj_enc_to_buf(struct m0_xcode_obj *obj, void **buf, m0_bcount_t *len)
M0_INTERNAL void m0_fom_mod_rep_fill(struct m0_fop_mod_rep *rep, struct m0_fom *fom)
M0_INTERNAL int m0_rpc_at_get(const struct m0_rpc_at_buf *ab, struct m0_buf *buf)
static struct m0_sm_conf cas_sm_conf
struct m0_be_tx_credit tx_betx_cred
M0_INTERNAL const struct m0_fid_type m0_cctg_fid_type
struct m0_cas_kv * cv_rec
const struct m0_rpc_item_type * ri_type
M0_INTERNAL const struct m0_fid_type * m0_fid_type_getfid(const struct m0_fid *fid)
struct m0_ctg_op cf_ctg_op
M0_INTERNAL int m0_rpc_at_reply_rc(struct m0_rpc_at_buf *out)
static bool cas_service_started(struct m0_fop *fop, struct m0_reqh *reqh)
M0_INTERNAL void m0_cas_gc_fini(void)
M0_INTERNAL struct m0_be_domain * m0_cas__ut_svc_be_get(struct m0_reqh_service *svc)
static int cas_at_reply(struct m0_rpc_at_buf *in, struct m0_rpc_at_buf *out, struct m0_buf *repbuf, struct m0_fom *fom, int next_phase)
M0_INTERNAL void m0_ctg_create_credit(struct m0_be_tx_credit *accum)
static const struct m0_fom_type_ops cas_fom_type_ops
union m0_rpc_at_buf::@447 u
struct m0_cas_recv cg_rec
M0_INTERNAL void m0_ctg_meta_cursor_init(struct m0_ctg_op *ctg_op)
M0_INTERNAL void m0_cas_gc_wait_sync(void)
static struct m0_cas_rec * cas_out_at(const struct m0_cas_rep *rep, int idx)
M0_INTERNAL uint32_t m0_dix_fid_cctg_device_id(const struct m0_fid *cctg_fid)
static const struct m0_reqh_service_ops cas_service_ops
M0_INTERNAL void m0_buf_free(struct m0_buf *buf)
M0_INTERNAL void m0_ctg_cursor_init(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg)
M0_INTERNAL void m0_ctg_op_get_ver(struct m0_ctg_op *ctg_op, struct m0_crv *out)
static int cas_incoming_kv_setup(struct cas_fom *fom, const struct m0_cas_op *op)
static int cas_id_check(const struct m0_cas_id *cid)
struct m0_cas_kv_vec cr_kv_bufs
union m0_dix_layout::@145 u
M0_INTERNAL int m0_buf_copy(struct m0_buf *dest, const struct m0_buf *src)
static int cas_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
M0_INTERNAL bool m0_dix_imask_is_empty(const struct m0_dix_imask *mask)
M0_INTERNAL void m0_ctg_op_init(struct m0_ctg_op *ctg_op, struct m0_fom *fom, uint32_t flags)
M0_INTERNAL int m0_xcode_data_size(struct m0_xcode_ctx *ctx, const struct m0_xcode_obj *obj)
M0_INTERNAL void m0_cas_svc_fop_args(struct m0_sm_conf **sm_conf, const struct m0_fom_type_ops **fom_ops, struct m0_reqh_service_type **svctype)
int m0_reqh_service_async_start_simple(struct m0_reqh_service_start_async_ctx *asc)
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
static enum m0_cas_opcode m0_cas_opcode(const struct m0_fop *fop)
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
#define m0_forall(var, nr,...)
struct m0_long_lock_addb2 cf_lock_addb2
M0_INTERNAL struct m0_reqh_service_type m0_cas_service_type
static void cas_fom_fini(struct m0_fom *fom0)
struct m0_dtm0_tx_pa * dtp_pa
static bool op_is_index_drop(enum m0_cas_opcode opc, enum m0_cas_type ct)
static uint64_t cas_out_nr(const struct m0_fop *fop)
M0_INTERNAL bool m0_dtm0_tx_desc_is_none(const struct m0_dtm0_tx_desc *td)
M0_INTERNAL struct m0_reqh_service * m0_reqh_service_find(const struct m0_reqh_service_type *st, const struct m0_reqh *reqh)
static int cas_done(struct cas_fom *fom, struct m0_cas_op *op, struct m0_cas_rep *rep, enum m0_cas_opcode opc)
#define CID_IMASK_PTR(cid)
M0_INTERNAL void m0_ctg_cursor_kv_get(struct m0_ctg_op *ctg_op, struct m0_buf *key, struct m0_buf *val)
static int cas_ctidx_lookup(struct cas_fom *fom, const struct m0_cas_id *in_cid, int next)
int(* rsto_service_allocate)(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
#define M0_BUF_INIT_PTR(p)
static int cas_kv_load_done(struct cas_fom *fom, enum m0_cas_opcode opc, const struct m0_cas_op *op, int phase)
struct m0_cas_ctg ** cf_moved_ctgs
static int cas_fom_tick(struct m0_fom *fom0)
struct m0_sm_state_descr * scf_state
#define M0_FI_ENABLED(tag)
const struct m0_reqh_service_type * rs_type
struct m0_sm_trans_descr cas_fom_trans[]
M0_INTERNAL void(* cas__ut_cb_done)(struct m0_fom *fom)
static int cas_sdev_state(struct m0_poolmach *pm, uint32_t sdev_idx, enum m0_pool_nd_state *state_out)
struct m0_reqh_service * fo_service
M0_INTERNAL void m0_fop_release(struct m0_ref *ref)
#define M0_ALLOC_PTR(ptr)
static void cas_service_stop(struct m0_reqh_service *service)
M0_INTERNAL void m0_be_dtm0_log_credit(enum m0_be_dtm0_log_credit_op op, struct m0_dtm0_tx_desc *txd, struct m0_buf *payload, struct m0_be_seg *seg, struct m0_dtm0_log_rec *rec, struct m0_be_tx_credit *accum)
M0_INTERNAL int m0_xcode_obj_dec_from_buf(struct m0_xcode_obj *obj, void *buf, m0_bcount_t len)
M0_INTERNAL uint64_t m0_rpc_at_len(const struct m0_rpc_at_buf *ab)
struct m0_rpc_session * ri_session
static int cas_at_load(struct m0_rpc_at_buf *ab, struct m0_fom *fom, int next_phase)
static struct m0_net_test_service svc
M0_INTERNAL int m0_fom_rc(const struct m0_fom *fom)
M0_INTERNAL void m0_ctg_ctidx_delete_credits(struct m0_cas_id *cid, struct m0_be_tx_credit *accum)
struct m0_sm_trans_descr m0_generic_phases_trans[]
M0_INTERNAL int m0_ctg_meta_delete(struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
static void cas_prep(struct cas_fom *fom, enum m0_cas_opcode opc, enum m0_cas_type ct, struct m0_cas_ctg *ctg, uint64_t rec_pos, struct m0_be_tx_credit *accum)
M0_INTERNAL void m0_rpc_at_fini(struct m0_rpc_at_buf *ab)
struct m0_rpc_at_buf cr_key
void m0_fop_put_lock(struct m0_fop *fop)
static const struct m0_fom_ops cas_fom_ops
static struct m0_fop * fop
struct m0_long_lock_link cf_lock
static int cas_op_recs_check(struct cas_fom *fom, enum m0_cas_opcode opc, enum m0_cas_type ct, struct m0_cas_op *op)
static bool cas_key_need_to_send(struct cas_fom *fom, enum m0_cas_opcode opc, enum m0_cas_type ct, struct m0_cas_op *op, uint64_t rec_pos)
M0_INTERNAL void m0_fom_queue(struct m0_fom *fom)
struct m0_dtm0_tx_participants dtd_ps
static int cas_exec(struct cas_fom *fom, enum m0_cas_opcode opc, enum m0_cas_type ct, struct m0_cas_ctg *ctg, uint64_t rec_pos, int next)
M0_INTERNAL struct m0_cas_ctg * m0_ctg_ctidx(void)
static bool cas_is_valid(struct cas_fom *fom, enum m0_cas_opcode opc, enum m0_cas_type ct, const struct m0_cas_rec *rec, uint64_t rec_pos)
struct m0_fop * fo_rep_fop
#define M0_XCODE_OBJ(type, ptr)
M0_INTERNAL struct m0_fop_type cas_put_fopt
static int cas_device_check(const struct cas_fom *fom, const struct m0_cas_id *cid)
M0_INTERNAL void m0_ctg_op_fini(struct m0_ctg_op *ctg_op)
static int cas_ctg_crow_fop_buf_prepare(const struct m0_cas_id *cid, struct m0_rpc_at_buf *at_buf)
static int cas_dtm0_logrec_credit_add(struct m0_fom *fom0)
static struct m0_cas_rec repv[N]
static m0_bcount_t cas_rpc_cutoff(const struct cas_fom *fom)
M0_INTERNAL void m0_cas_gc_start(struct m0_reqh_service *service)
static struct m0_cas_op * cas_op(const struct m0_fom *fom)
M0_INTERNAL void m0_long_read_unlock(struct m0_long_lock *lock, struct m0_long_lock_link *link)
M0_INTERNAL bool m0_long_read_lock(struct m0_long_lock *lk, struct m0_long_lock_link *link, int next_phase)
void m0_fom_phase_set(struct m0_fom *fom, int phase)
bool cf_startkey_excluded
static bool cas_fid_is_cctg(const struct m0_fid *fid)
M0_INTERNAL void m0_sm_conf_fini(struct m0_sm_conf *conf)
M0_INTERNAL void * m0_alloc_aligned(size_t size, unsigned shift)
static bool cas_ctidx_op_needed(struct cas_fom *fom, enum m0_cas_opcode opc, enum m0_cas_type ct, uint64_t rec_pos)
M0_INTERNAL int m0_dtm0_logrec_update(struct m0_be_dtm0_log *log, struct m0_be_tx *tx, struct m0_dtm0_tx_desc *txd, struct m0_buf *payload)
M0_INTERNAL bool m0_fid_is_valid(const struct m0_fid *fid)
struct m0_long_lock_addb2 cf_meta_addb2
static void cas_service_prepare_to_stop(struct m0_reqh_service *svc)
struct m0_cas_recv cgr_rep
M0_INTERNAL uint64_t m0_sm_id_get(const struct m0_sm *sm)
static int cas_service_start(struct m0_reqh_service *service)
static void addb2_add_kv_attrs(const struct cas_fom *fom, enum stats_kv_io kv_io)
struct m0_long_lock_link cf_meta
struct m0_rpc_item f_item
const struct m0_reqh_service_type * ft_rstype
void m0_reqh_service_type_unregister(struct m0_reqh_service_type *rstype)
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
static void cas_incoming_kv(const struct cas_fom *fom, uint64_t rec_pos, struct m0_buf *key, struct m0_buf *val)
struct m0_pdclust_src_addr src
struct m0_reqh_service dos_generic
M0_INTERNAL int m0_ctg_meta_cursor_get(struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
int(* rso_start_async)(struct m0_reqh_service_start_async_ctx *asc)
static int cas_ctg_crow_handle(struct cas_fom *fom, const struct m0_cas_id *cid)
M0_INTERNAL void(* cas__ut_cb_fini)(struct m0_fom *fom)
M0_INTERNAL int m0_ctg_op_rc(struct m0_ctg_op *ctg_op)
static int cas_ctidx_mem_place(struct cas_fom *fom, const struct m0_cas_id *in_cid, int next)
M0_INTERNAL struct m0_long_lock * m0_ctg_del_lock(void)
M0_INTERNAL struct m0_reqh * m0_fom_reqh(const struct m0_fom *fom)
M0_INTERNAL struct m0_fop_type cas_rep_fopt
static size_t cas_fom_home_locality(const struct m0_fom *fom)
M0_INTERNAL struct m0_cas_ctg * m0_ctg_meta_lookup_result(struct m0_ctg_op *ctg_op)
static void cas_fom_failure(struct cas_fom *fom, int rc, bool ctg_op_fini)
#define M0_IMPOSSIBLE(fmt,...)
static int cas_val_send(struct cas_fom *fom, const struct m0_cas_op *op, enum m0_cas_opcode opc, const struct m0_cas_rep *rep, enum cas_fom_phase next_phase)
static struct m0_sm_state_descr cas_fom_phases[]