23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CAS 179 static int ctg_cmp (
const void *
key0,
const void *key1);
243 value->gv_version = *crv;
263 key->gk_length =
src->b_nob;
264 memcpy(
key->gk_data,
src->b_addr,
src->b_nob);
294 *crv =
value->gv_version;
350 if (
buf->b_nob <
sizeof(*
key))
352 if (
key->gk_length !=
buf->b_nob -
sizeof(*
key))
355 buf->b_nob =
key->gk_length;
356 buf->b_addr = &
key->gk_data[0];
361 #define FID_KEY_INIT(__fid) (struct fid_key) { \ 363 .gk_length = sizeof(*(__fid)), \ 365 .fk_fid = *(__fid), \ 368 #define GENERIC_VALUE_INIT(__size) (struct generic_value) { \ 369 .gv_length = __size, \ 370 .gv_version = M0_CRV_INIT_NONE, \ 373 #define META_VALUE_INIT(__ctg_ptr) (struct meta_value) { \ 374 .mv_gval = GENERIC_VALUE_INIT(sizeof(__ctg_ptr)), \ 375 .mv_ctg = (__ctg_ptr), \ 378 #define LAYOUT_VALUE_INIT(__layout) (struct layout_value) { \ 379 .lv_gval = GENERIC_VALUE_INIT(sizeof(*(__layout))), \ 380 .lv_layout = *(__layout), \ 386 return sizeof(*key) +
key->gk_length;
392 return sizeof(*val) +
val->gv_length;
395 static int ctg_cmp(
const void *opaque_key_left,
const void *opaque_key_right)
398 const struct generic_key *right = opaque_key_right;
418 .ot_version = M0_CAS_CTG_FORMAT_VERSION,
419 .ot_type = M0_FORMAT_TYPE_CAS_CTG,
420 .ot_footer_offset = offsetof(struct m0_cas_ctg, cc_foot)
504 const struct m0_fid *ctg_fid,
520 bo_u.u_btree.t_rc) ?:
663 .ot_version = M0_CAS_STATE_FORMAT_VERSION,
664 .ot_type = M0_FORMAT_TYPE_CAS_STATE,
665 .ot_footer_offset = offsetof(struct m0_cas_state, cs_footer)
669 bt = &
out->cs_meta->cc_tree;
781 goto dead_index_destroy;
785 goto dead_index_delete;
838 "cas_state from storage: cs_meta %p, cs_rec_nr %"PRIx64,
839 state->cs_meta, state->cs_rec_nr);
841 }
else if (result == -ENOENT) {
855 return M0_RC(result);
881 "Ctg store counter overflow: counter %" 980 int ct = ctg_op->
co_ct;
1127 if (next_state >= 0)
1152 int ct = ctg_op->
co_ct;
1159 ctg_op->co_val.
b_nob;
1203 if (ctg_op->co_cur_phase ==
CPH_GET)
1218 int ct = ctg_op->
co_ct;
1243 M0_IMPOSSIBLE(
"The other operations are not allowed here.");
1275 if (next_phase >= 0)
1295 int ct = ctg_op->
co_ct;
1326 if (ctg_op->
co_rc != 0) {
1433 if (ctg_op->
co_rc != 0)
1494 if (ctg_op->
co_rc == 0)
1498 if (ctg_op->
co_rc != 0 && ctg_op->
co_rc != -ENOENT) {
1527 if (ctg_op->
co_rc != 0) {
1534 if (ctg_op->
co_rc != 0)
1785 return ctg_op->
co_rc;
1813 knob =
sizeof(
struct fid_key);
1832 knob =
sizeof(
struct fid_key);
1853 records_nr = records_nr ?: 1;
1854 for (records_ok = 0;
1862 &record_cred) && records_ok < records_nr;
1876 if (records_ok > 0 && records_nr >= records_ok) {
1878 nodes_cred.
tc_reg_nr * records_ok / records_nr;
1884 *limit = records_ok;
1940 knob =
sizeof(
struct fid_key);
2001 bo_u.u_btree.t_rc) ?:
2052 layout->
u.dl_desc.ld_imask.im_range =
im_range;
2075 imask = &layout->
u.dl_desc.ld_imask;
2190 (
int)
key->b_nob - key_header_len,
2191 (
const char*)(
key->b_addr + key_header_len),
2192 (
int)
val->b_nob - val_header_len,
2193 (
const char*)(
val->b_addr + val_header_len));
2198 for (
i = 0;
i <
key->b_nob - key_header_len;
i++)
2199 sprintf(kbuf + 2 *
i,
"%2x",
2200 *(uint8_t*)(
key->b_addr + key_header_len +
i));
2205 for (
i = 0;
i <
val->b_nob - val_header_len;
i++)
2206 sprintf(vbuf + 2 *
i,
"%2x",
2207 *(uint8_t*)(
val->b_addr + val_header_len +
i));
2239 struct m0_fid out_fid = { 0, 0};
2245 bool dumped =
false;
2246 bool dump_in_hex =
false;
2249 if (
m0_streq(
"hex", dump_in_hex_str))
2288 return rc? : dumped? 0 : -ENOENT;
2306 return M0_RC_INFO(
false,
"Non-ordinary catalogue.");
2309 return M0_RC_INFO(
false,
"No fom, no versions.");
2312 return M0_RC_INFO(
false,
"No fop, no versions.");
2316 return M0_RC_INFO(
false,
"No cas op, no versions.");
2319 return M0_RC_INFO(
false,
"CAS request is not versioned.");
2327 "PUT request without OVERWRITE is " 2334 "%s request is has an empty txd.",
2344 return M0_RC_INFO(
false,
"Non-versioned operation.");
2359 "Versioned op without FOM?");
2367 ", ver_enc=%" PRIu64, ctg_op,
2372 M0_LEAVE(
"ctg_op=%p, no version", ctg_op);
2396 "Versioned PUT or DEL without a valid version?");
2413 bo_u.u_btree.t_rc) ?:
2419 if (!M0_IN(
rc, (0, -ENOENT)))
2473 bo_u.u_btree.t_rc) ?:
2558 (slant ? -EAGAIN : -ENOENT) : 0;
2564 "btree cursor op returned EAGAIN?");
2574 #undef M0_TRACE_SUBSYSTEM static int versioned_cursor_next_sync(struct m0_ctg_op *op, bool alive_only)
struct generic_value lv_gval
M0_INTERNAL void m0_long_lock_fini(struct m0_long_lock *lock)
struct m0_be_long_lock cc_lock
M0_INTERNAL void m0_be_btree_insert_inplace(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_buf *key, struct m0_be_btree_anchor *anchor, uint64_t zonemask)
#define M0_BE_ALLOC_CREDIT_PTR(ptr, seg, accum)
M0_INTERNAL void m0_be_btree_cursor_next(struct m0_be_btree_cursor *cur)
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_be_domain * bs_domain
struct m0_be_op::@39::m0_be_op__btree u_btree
struct m0_dtm0_tx_desc cg_txd
struct m0_be_mutex cs_ctg_init_mutex
static struct m0_be_active_record_domain dummy
#define M0_BE_ALLOC_PTR_SYNC(ptr, seg, tx)
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL int m0_ctg_meta_insert(struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
M0_INTERNAL void m0_be_btree_delete_credit(const struct m0_be_btree *tree, m0_bcount_t nr, m0_bcount_t ksize, m0_bcount_t vsize, struct m0_be_tx_credit *accum)
#define M0_BUF_INIT_PTR_CONST(p)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
M0_INTERNAL void m0_dix_fid_convert_cctg2dix(const struct m0_fid *cctg_fid, struct m0_fid *dix_fid)
M0_INTERNAL int m0_be_seg_dict_insert(struct m0_be_seg *seg, struct m0_be_tx *tx, const char *name, void *value)
struct m0_cas_ctg * cs_dead_index
M0_INTERNAL int m0_ctg_dead_index_insert(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, int next_phase)
M0_INTERNAL void m0_chan_broadcast_lock(struct m0_chan *chan)
int const char const void size_t int flags
static struct m0_be_seg * cas_seg(struct m0_be_domain *dom)
struct generic_key fk_gkey
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
M0_INTERNAL void m0_clink_del(struct m0_clink *link)
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)
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)
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
M0_INTERNAL void m0_be_btree_clear_credit(struct m0_be_btree *tree, struct m0_be_tx_credit *fixed_part, struct m0_be_tx_credit *single_record, m0_bcount_t *records_nr)
static struct m0_be_op * ctg_beop(struct m0_ctg_op *ctg_op)
M0_INTERNAL void m0_ctg_lookup_result(struct m0_ctg_op *ctg_op, struct m0_buf *buf)
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)
static uint32_t ctg_op_zones(const struct m0_ctg_op *ctg_op)
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)
static struct m0_sm_group * grp
M0_INTERNAL int m0_ctg_meta_cursor_next(struct m0_ctg_op *ctg_op, int next_phase)
M0_INTERNAL void m0_be_btree_save_inplace(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_buf *key, struct m0_be_btree_anchor *anchor, bool overwrite, uint64_t zonemask)
#define M0_LOG(level,...)
#define M0_BE_ALLOC_CREDIT_ARR(arr, nr, seg, accum)
void m0_console_printf(const char *fmt,...)
struct m0_be_seg * bb_seg
M0_INTERNAL void m0_be_tx_fini(struct m0_be_tx *tx)
M0_INTERNAL void m0_ctg_fini(struct m0_fom *fom, struct m0_cas_ctg *ctg)
static void ctg_store_release(struct m0_ref *ref)
M0_INTERNAL uint64_t m0_ctg_rec_nr(void)
struct m0_cas_ctg * cs_meta
M0_INTERNAL void m0_ctg_dead_clean_credit(struct m0_be_tx_credit *accum)
#define M0_BE_OP_SYNC(op_obj, action)
#define M0_BE_ALLOC_BUF(buf, seg, tx, op)
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 ctg_is_ordinary(const struct m0_cas_ctg *ctg)
M0_INTERNAL const struct m0_fid m0_cas_meta_fid
struct m0_cas_ctg * cs_ctidx
struct m0_dix_layout ci_layout
M0_INTERNAL int m0_ctg_ctidx_lookup_sync(const struct m0_fid *fid, struct m0_dix_layout **layout)
int const char const void * value
M0_INTERNAL struct m0_be_seg * m0_be_domain_seg0_get(struct m0_be_domain *dom)
M0_INTERNAL bool m0_dix_fid_validate_cctg(const struct m0_fid *cctg_fid)
static int ctg_kbuf_get(struct m0_buf *dst, const struct m0_buf *src, bool enabled_fi)
M0_INTERNAL void m0_be_op_unlock(struct m0_be_op *op)
void * m0_fop_data(const struct m0_fop *fop)
M0_INTERNAL void m0_be_tx_prep(struct m0_be_tx *tx, const struct m0_be_tx_credit *credit)
#define M0_BE_TX_CAPTURE_PTR(seg, tx, ptr)
static int ctg_mem_op_exec(struct m0_ctg_op *ctg_op, int next_phase)
M0_INTERNAL int m0_ctg_minkey(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, int next_phase)
static bool ctg_op_cb(struct m0_clink *clink)
M0_INTERNAL bool m0_clink_is_armed(const struct m0_clink *link)
static m0_bcount_t ctg_vbuf_packed_size(const struct m0_buf *value)
static void ctg_meta_delete(struct m0_be_btree *meta, const struct m0_fid *fid, struct m0_be_tx *tx)
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
static int versioned_cursor_get_sync(struct m0_ctg_op *op, bool alive_only)
M0_INTERNAL void m0_chan_lock(struct m0_chan *ch)
M0_INTERNAL void m0_be_btree_create(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_fid *btree_fid)
M0_INTERNAL struct m0_cas_ctg * m0_ctg_dead_index(void)
M0_INTERNAL int m0_ctg_cursor_get(struct m0_ctg_op *ctg_op, const struct m0_buf *key, int next_phase)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
M0_INTERNAL void m0_cas_gc_wait_async(struct m0_be_op *beop)
M0_INTERNAL void m0_be_btree_destroy_credit(struct m0_be_btree *tree, struct m0_be_tx_credit *accum)
struct m0_dix_layout lv_layout
#define M0_BE_REG(seg, size, addr)
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)
struct m0_be_btree cc_tree
static void ctg_meta_insert_credit(struct m0_be_btree *bt, m0_bcount_t nr, struct m0_be_tx_credit *accum)
M0_INTERNAL void m0_be_btree_cursor_put(struct m0_be_btree_cursor *cursor)
struct m0_be_ut_backend rc_be
static struct m0_be_tx * m0_fom_tx(struct m0_fom *fom)
static const struct m0_fid * cas_fid(const struct m0_fom *fom)
static int ctg_meta_selfadd(struct m0_be_btree *meta, struct m0_be_tx *tx)
M0_INTERNAL void m0_be_btree_delete(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_buf *key)
M0_INTERNAL void m0_be_btree_cursor_fini(struct m0_be_btree_cursor *cursor)
M0_INTERNAL void m0_buf_memcpy(struct m0_buf *dst, const struct m0_buf *src)
static void ctg_init(struct m0_cas_ctg *ctg, struct m0_be_seg *seg)
#define FID_KEY_INIT(__fid)
M0_INTERNAL bool m0_ctg_cursor_is_initialised(struct m0_ctg_op *ctg_op)
struct m0_long_lock llock
M0_INTERNAL int m0_be_btree_cursor_next_sync(struct m0_be_btree_cursor *cur)
static int btree(struct scanner *s, struct rectype *r, char *buf)
#define M0_BE_TX_CREDIT(nr, size)
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_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)
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
M0_INTERNAL int m0_ctg_cursor_next(struct m0_ctg_op *ctg_op, int next_phase)
M0_INTERNAL int m0_ctg_meta_lookup(struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
static int ctg_op_exec_versioned(struct m0_ctg_op *ctg_op, int next_phase)
M0_INTERNAL void m0_ctg_cursor_fini(struct m0_ctg_op *ctg_op)
union m0_be_mutex::@196 bm_u
#define M0_RC_INFO(rc, fmt,...)
static struct m0_mutex cs_init_guard
M0_INTERNAL void m0_ref_put(struct m0_ref *ref)
#define M0_ERR_INFO(rc, fmt,...)
static int versioned_put_sync(struct m0_ctg_op *ctg_op)
static void ctg_store_init_creds_calc(struct m0_be_seg *seg, struct m0_cas_state *state, struct m0_cas_ctg *ctidx, struct m0_be_tx_credit *cred)
void m0_ref_init(struct m0_ref *ref, int init_num, void(*release)(struct m0_ref *ref))
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL void m0_ref_get(struct m0_ref *ref)
#define M0_BE_OP_SYNC_RET(op_obj, action, member)
M0_INTERNAL void m0_be_btree_insert_credit2(const struct m0_be_btree *tree, m0_bcount_t nr, m0_bcount_t ksize, m0_bcount_t vsize, struct m0_be_tx_credit *accum)
M0_INTERNAL void m0_ctg_try_init(struct m0_cas_ctg *ctg)
static int ctg_op_exec_normal(struct m0_ctg_op *ctg_op, int next_phase)
struct m0_be_mutex cc_chan_guard
M0_INTERNAL void m0_be_btree_create_credit(const struct m0_be_btree *tree, m0_bcount_t nr, struct m0_be_tx_credit *accum)
static void ctg_state_counter_add(uint64_t *counter, uint64_t val)
M0_INTERNAL const struct m0_be_btree_kv_ops * m0_ctg_btree_ops(void)
#define M0_FID_TINIT(type, container, key)
M0_INTERNAL void m0_ctg_cursor_put(struct m0_ctg_op *ctg_op)
#define M0_AMB(obj, ptr, field)
M0_INTERNAL int m0_ctg_mem_place(struct m0_ctg_op *ctg_op, const struct m0_buf *buf, int next_phase)
#define CTG_OP_COMBINE(opc, ct)
M0_INTERNAL struct m0_cas_ctg * m0_ctg_meta(void)
M0_INTERNAL void m0_be_btree_lookup_inplace(struct m0_be_btree *tree, struct m0_be_op *op, const struct m0_buf *key, struct m0_be_btree_anchor *anchor)
M0_INTERNAL const struct m0_fid_type m0_dix_fid_type
#define M0_BE_TX_CAPTURE_BUF(seg, tx, buf)
M0_INTERNAL void m0_chan_init(struct m0_chan *chan, struct m0_mutex *ch_guard)
static void ctg_destroy(struct m0_cas_ctg *ctg, struct m0_be_tx *tx)
M0_INTERNAL void m0_be_btree_destroy(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op)
M0_BASSERT(sizeof(struct generic_key)==M0_CAS_CTG_KEY_HDR_SIZE)
M0_INTERNAL void m0_be_btree_release(struct m0_be_tx *tx, struct m0_be_btree_anchor *anchor)
struct m0_be_chan cc_chan
M0_INTERNAL bool cas_in_ut(void)
static const char cas_state_key[]
M0_INTERNAL void m0_be_tx_credit_add(struct m0_be_tx_credit *c0, const struct m0_be_tx_credit *c1)
M0_INTERNAL int m0_crv_cmp(const struct m0_crv *left, const struct m0_crv *right)
M0_INTERNAL int m0_ctg_store_init(struct m0_be_domain *dom)
M0_INTERNAL int ctg_index_btree_dump(struct m0_motr *motr_ctx, struct m0_cas_ctg *ctg, bool dump_in_hex)
static struct m0_stob_domain * dom
union m0_be_long_lock::@190 bll_u
M0_INTERNAL void m0_ctg_mark_deleted_credit(struct m0_be_tx_credit *accum)
#define META_VALUE_INIT(__ctg_ptr)
M0_INTERNAL int m0_ctg__meta_insert(struct m0_be_btree *meta, const struct m0_fid *fid, struct m0_cas_ctg *ctg, struct m0_be_tx *tx)
struct m0_be_domain * eng_domain
void * m0_alloc(size_t size)
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
static int ctg_store_create(struct m0_be_seg *seg)
M0_INTERNAL void m0_be_btree_fini(struct m0_be_btree *tree)
M0_INTERNAL int m0_be_tx_exclusive_open_sync(struct m0_be_tx *tx)
M0_INTERNAL void m0_ctg_create_credit(struct m0_be_tx_credit *accum)
M0_INTERNAL void m0_be_btree_minkey(struct m0_be_btree *tree, struct m0_be_op *op, struct m0_buf *out)
struct m0_be_btree_anchor co_anchor
M0_INTERNAL uint64_t m0_ctg_rec_size(void)
static void ctg_state_destroy(struct m0_cas_state *state, struct m0_be_tx *tx)
static int ctg_berc(struct m0_ctg_op *ctg_op)
M0_INTERNAL bool m0_crv_tbs(const struct m0_crv *crv)
struct m0_sm_group * lo_grp
static int ctg_state_create(struct m0_be_seg *seg, struct m0_be_tx *tx, struct m0_cas_state **state)
M0_INTERNAL void m0_be_op_done(struct m0_be_op *op)
M0_INTERNAL const struct m0_fid m0_cas_dead_index_fid
M0_INTERNAL void m0_ctg_meta_cursor_init(struct m0_ctg_op *ctg_op)
static void ctg_vbuf_pack(struct m0_buf *dst, const struct m0_buf *src, const struct m0_crv *crv)
static void ctg_state_counter_sub(uint64_t *counter, uint64_t val)
M0_INTERNAL void m0_buf_free(struct m0_buf *buf)
M0_INTERNAL int m0_ctg_meta_find_ctg(struct m0_cas_ctg *meta, const struct m0_fid *ctg_fid, struct m0_cas_ctg **ctg)
M0_INTERNAL void m0_ctg_cursor_init(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg)
M0_INTERNAL bool m0_be_should_break_half(struct m0_be_engine *eng, const struct m0_be_tx_credit *accum, const struct m0_be_tx_credit *delta)
M0_INTERNAL void m0_ctg_op_get_ver(struct m0_ctg_op *ctg_op, struct m0_crv *out)
M0_INTERNAL int m0_be_btree_cursor_first_sync(struct m0_be_btree_cursor *cur)
static struct m0_clink clink[RDWR_REQUEST_MAX]
M0_INTERNAL int m0_fid_sscanf(const char *s, struct m0_fid *fid)
struct m0_be_btree_cursor co_cur
static void ctg_fini(struct m0_cas_ctg *ctg)
int m0_ctg_create(struct m0_be_seg *seg, struct m0_be_tx *tx, struct m0_cas_ctg **out, const struct m0_fid *cas_fid)
static int ctg_exec(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, const struct m0_buf *key, int next_phase)
union m0_dix_layout::@145 u
#define M0_BE_FREE_PTR_SYNC(ptr, seg, tx)
M0_INTERNAL int m0_buf_copy(struct m0_buf *dest, const struct m0_buf *src)
struct m0_be_domain but_dom
struct m0_long_lock cs_del_lock
static int ctg_vbuf_unpack(struct m0_buf *buf, struct m0_crv *crv)
M0_INTERNAL void m0_chan_unlock(struct m0_chan *ch)
static void ctg_ctidx_op_credits(struct m0_cas_id *cid, bool insert, struct m0_be_tx_credit *accum)
static int ctg_mem_exec(struct m0_ctg_op *ctg_op, int next_phase)
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 void m0_be_btree_cursor_kv_get(struct m0_be_btree_cursor *cur, struct m0_buf *key, struct m0_buf *val)
static void ctg_meta_selfrm(struct m0_be_btree *meta, struct m0_be_tx *tx)
static void ctg_state_dec_update(struct m0_be_tx *tx, uint64_t size)
#define M0_BE_FREE_PTR(ptr, seg, tx, op)
M0_INTERNAL void m0_be_tx_init(struct m0_be_tx *tx, uint64_t tid, struct m0_be_domain *dom, struct m0_sm_group *sm_group, m0_be_tx_cb_t persistent, m0_be_tx_cb_t discarded, void(*filler)(struct m0_be_tx *tx, void *payload), void *datum)
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
static m0_bcount_t ctg_ksize(const void *key)
#define LAYOUT_VALUE_INIT(__layout)
M0_INTERNAL void m0_long_lock_init(struct m0_long_lock *lock)
static uint64_t ctg_state_update(struct m0_be_tx *tx, uint64_t size, bool is_inc)
struct m0_cas_ctg * co_ctg
static int ctg_cmp(const void *key0, const void *key1)
M0_INTERNAL void m0_be_op_reset(struct m0_be_op *op)
M0_INTERNAL int m0_ctg_ctidx_delete_sync(const struct m0_cas_id *cid, struct m0_be_tx *tx)
M0_INTERNAL bool m0_crv_is_none(const struct m0_crv *crv)
M0_INTERNAL bool m0_dtm0_tx_desc_is_none(const struct m0_dtm0_tx_desc *td)
struct m0_be_domain * cs_be_domain
M0_INTERNAL void m0_ctg_state_inc_update(struct m0_be_tx *tx, uint64_t size)
M0_INTERNAL void m0_be_op_active(struct m0_be_op *op)
static int ctg_store__init(struct m0_be_seg *seg, struct m0_cas_state *state)
static void ctg_meta_delete_credit(struct m0_be_btree *bt, m0_bcount_t nr, struct m0_be_tx_credit *accum)
M0_INTERNAL void m0_ctg_cursor_kv_get(struct m0_ctg_op *ctg_op, struct m0_buf *key, struct m0_buf *val)
#define M0_BUF_INIT_PTR(p)
static int ctg_kbuf_unpack(struct m0_buf *buf)
M0_INTERNAL struct m0_locality * m0_locality0_get(void)
static int ctg_op_exec(struct m0_ctg_op *ctg_op, int next_phase)
struct m0_reqh_context cc_reqh_ctx
static struct m0_chan chan[RDWR_REQUEST_MAX]
#define M0_FI_ENABLED(tag)
M0_INTERNAL void m0_clink_add(struct m0_chan *chan, struct m0_clink *link)
M0_INTERNAL void ctg_index_btree_dump_one_rec(struct m0_buf *key, struct m0_buf *val, bool dump_in_hex)
M0_INTERNAL void m0_be_btree_cursor_get(struct m0_be_btree_cursor *cur, const struct m0_buf *key, bool slant)
M0_INTERNAL int m0_ctg_ctidx_insert_sync(const struct m0_cas_id *cid, struct m0_be_tx *tx)
M0_INTERNAL void m0_crv_init(struct m0_crv *crv, const struct m0_dtm0_ts *ts, bool tbs)
M0_INTERNAL void m0_ctg_ctidx_delete_credits(struct m0_cas_id *cid, struct m0_be_tx_credit *accum)
M0_INTERNAL int m0_ctg_meta_delete(struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
M0_INTERNAL void m0_be_op_fini(struct m0_be_op *op)
enum m0_dtx_state tx_state
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
#define M0_BE_ALLOC_ARR_SYNC(arr, nr, seg, tx)
int ctgdump(struct m0_motr *motr_ctx, char *fidstr, char *dump_in_hex_str)
M0_INTERNAL void m0_be_btree_init(struct m0_be_btree *tree, struct m0_be_seg *seg, const struct m0_be_btree_kv_ops *ops)
#define M0_MUTEX_SINIT(m)
M0_INTERNAL void m0_be_btree_cursor_init(struct m0_be_btree_cursor *cur, struct m0_be_btree *btree)
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
M0_INTERNAL struct m0_cas_ctg * m0_ctg_ctidx(void)
static struct m0_be_seg * seg
static int ctg_vbuf_as_layout(const struct m0_buf *buf, struct m0_dix_layout **layout)
static int ctg_vbuf_as_ctg(const struct m0_buf *val, struct m0_cas_ctg **ctg)
#define M0_ASSERT_INFO(cond, fmt,...)
static int versioned_get_sync(struct m0_ctg_op *op)
M0_INTERNAL struct m0_be_seg * m0_be_domain_seg_first(const struct m0_be_domain *dom)
M0_INTERNAL void m0_be_tx_capture(struct m0_be_tx *tx, const struct m0_be_reg *reg)
M0_INTERNAL void m0_ctg_op_fini(struct m0_ctg_op *ctg_op)
struct m0_mutex cs_state_mutex
static int ctg_op_tick_ret(struct m0_ctg_op *ctg_op, int next_state)
struct m0_mutex co_channel_lock
static struct m0_cas_op * cas_op(const struct m0_fom *fom)
struct m0_cas_state * cs_state
M0_INTERNAL const struct m0_fid m0_cas_ctidx_fid
M0_INTERNAL int m0_ctg_drop(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, int next_phase)
void m0_fom_phase_set(struct m0_fom *fom, int phase)
struct m0_chan co_channel
M0_INTERNAL void m0_be_seg_dict_insert_credit(struct m0_be_seg *seg, const char *name, struct m0_be_tx_credit *accum)
static struct m0_ctg_store ctg_store
struct m0_format_header cc_head
M0_INTERNAL void m0_be_op_init(struct m0_be_op *op)
M0_INTERNAL void m0_chan_fini_lock(struct m0_chan *chan)
M0_INTERNAL int m0_be_seg_dict_lookup(struct m0_be_seg *seg, const char *name, void **out)
#define M0_BUF_INIT(size, data)
M0_INTERNAL void m0_be_btree_truncate(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, m0_bcount_t limit)
struct m0_pdclust_src_addr src
M0_INTERNAL int m0_ctg_meta_cursor_get(struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
M0_INTERNAL void m0_be_op_lock(struct m0_be_op *op)
static int ctg_meta_exec(struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
static void ctg_op_version_get(const struct m0_ctg_op *ctg_op, struct m0_crv *out)
static const struct m0_be_btree_kv_ops cas_btree_ops
#define M0_BE_FREE_CREDIT_ARR(arr, nr, seg, accum)
#define M0_BE_FREE_CREDIT_PTR(ptr, seg, accum)
M0_INTERNAL int m0_ctg_truncate(struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, m0_bcount_t limit, int next_phase)
M0_INTERNAL int m0_ctg_op_rc(struct m0_ctg_op *ctg_op)
M0_INTERNAL struct m0_long_lock * m0_ctg_del_lock(void)
static m0_bcount_t ctg_vsize(const void *val)
static bool ctg_op_is_versioned(const struct m0_ctg_op *op)
struct m0_be_engine * t_engine
M0_INTERNAL void m0_ctg_drop_credit(struct m0_fom *fom, struct m0_be_tx_credit *accum, struct m0_cas_ctg *ctg, m0_bcount_t *limit)
M0_INTERNAL void m0_be_tx_close_sync(struct m0_be_tx *tx)
M0_INTERNAL struct m0_cas_ctg * m0_ctg_meta_lookup_result(struct m0_ctg_op *ctg_op)
M0_INTERNAL void m0_fid_tassume(struct m0_fid *fid, const struct m0_fid_type *ft)
#define M0_IMPOSSIBLE(fmt,...)