24 #ifndef __MOTR_BE_TX_H__ 25 #define __MOTR_BE_TX_H__ 435 #if M0_DEBUG_BE_CREDITS == 1 441 #define M0_BE_CREDIT_INC(n, cr_user, credit) ({ \ 442 typeof(cr_user) cu = (cr_user); \ 443 typeof(credit) cr = (credit); \ 444 cr->tc_balance[cu] += (n); \ 445 M0_LOG(M0_DEBUG, "INC cr=%p user=%d balance=%d", cr, (int)cu, \ 446 cr->tc_balance[cu]); \ 454 #define M0_BE_CREDIT_DEC(cr_user, tx) ({ \ 455 struct m0_be_tx_credit *cr = &(tx)->t_prepared; \ 456 typeof(cr_user) cu = (cr_user); \ 457 M0_LOG(M0_DEBUG, "DEC cr=%p user=%d balance=%d", cr, (int)cu, \ 458 cr->tc_balance[cu]); \ 459 M0_CNT_DEC(cr->tc_balance[cu]); \ 464 #define M0_BE_CREDIT_INC(n, cr_user, credit) 465 #define M0_BE_CREDIT_DEC(cr_user, tx) 505 #define M0_BE_TX_CAPTURE_PTR(seg, tx, ptr) \ 506 m0_be_tx_capture((tx), &M0_BE_REG((seg), sizeof *(ptr), (ptr))) 507 #define M0_BE_TX_CAPTURE_ARR(seg, tx, arr, nr) \ 508 m0_be_tx_capture((tx), &M0_BE_REG((seg), (nr) * sizeof((arr)[0]), (arr))) 509 #define M0_BE_TX_CAPTURE_BUF(seg, tx, buf) \ 510 m0_be_tx_capture((tx), &M0_BE_REG((seg), (buf)->b_nob, (buf)->b_addr)) struct m0_be_tx_credit t_prepared
struct m0_sm_ast t_ast_grouping
struct m0_sm_ast t_ast_placed
struct m0_sm_ast t_ast_logged
M0_INTERNAL void m0_be_tx_lsn_set(struct m0_be_tx *tx, m0_bindex_t lsn, m0_bindex_t lsn_discarded)
m0_bcount_t t_log_reserved_size
struct m0_atomic64 t_fdmi_ref
M0_INTERNAL int m0_be_tx_timedwait(struct m0_be_tx *tx, uint64_t states, m0_time_t deadline)
struct m0_tlink t_fdmi_linkage
M0_INTERNAL void m0_be_tx__recovering_set(struct m0_be_tx *tx)
M0_INTERNAL bool m0_be_tx_should_break(struct m0_be_tx *tx, const struct m0_be_tx_credit *c)
M0_INTERNAL void m0_be_tx_fini(struct m0_be_tx *tx)
struct m0_sm_ast t_ast_done
M0_INTERNAL void m0_be_tx_exclusive_open(struct m0_be_tx *tx)
struct m0_tlink t_engine_linkage
M0_INTERNAL void m0_be_tx_prep(struct m0_be_tx *tx, const struct m0_be_tx_credit *credit)
M0_INTERNAL bool m0_be_tx__is_fast(struct m0_be_tx *tx)
m0_be_tx_cb_t t_discarded
struct m0_be_domain * t_dom
struct m0_tlink t_group_linkage
struct m0_tlink t_first_capture_linkage
M0_INTERNAL void m0_be_tx_deconstruct(struct m0_be_tx *tx, struct m0_be_fmt_tx *ftx)
struct m0_be_tx_group * t_group
M0_INTERNAL void m0_be_tx__group_assign(struct m0_be_tx *tx, struct m0_be_tx_group *gr)
static struct m0_addb2_callback c
struct m0_sm_ast t_ast_active
static struct m0_stob_domain * dom
M0_INTERNAL int m0_be_tx_open_sync(struct m0_be_tx *tx)
m0_bcount_t t_payload_prepared
M0_INTERNAL void m0_be_tx_close(struct m0_be_tx *tx)
M0_INTERNAL int m0_be_tx_exclusive_open_sync(struct m0_be_tx *tx)
M0_INTERNAL bool m0_be_tx__is_exclusive(const struct m0_be_tx *tx)
m0_bindex_t t_lsn_discarded
M0_INTERNAL void m0_be_tx_lsn_get(struct m0_be_tx *tx, m0_bindex_t *lsn, m0_bindex_t *lsn_discarded)
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_be_tx_get(struct m0_be_tx *tx)
struct m0_sm_ast t_ast_failed
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)
struct m0_sm_ast t_fdmi_put_ast
M0_INTERNAL void m0_be_tx_reconstruct(struct m0_be_tx *tx, const struct m0_be_fmt_tx *ftx)
void(* t_gc_free)(struct m0_be_tx *tx, void *param)
M0_INTERNAL void m0_be_tx_open(struct m0_be_tx *tx)
m0_be_tx_cb_t t_persistent
M0_INTERNAL void m0_be_tx_uncapture(struct m0_be_tx *tx, const struct m0_be_reg *reg)
M0_INTERNAL bool m0_be_should_break(struct m0_be_engine *eng, const struct m0_be_tx_credit *accum, const struct m0_be_tx_credit *delta)
M0_INTERNAL void m0_be_tx_put(struct m0_be_tx *tx)
M0_INTERNAL bool m0_be_tx__is_recovering(struct m0_be_tx *tx)
M0_INTERNAL void m0_be_tx_gc_enable(struct m0_be_tx *tx, void(*gc_free)(struct m0_be_tx *, void *param), void *param)
void(* t_filler)(struct m0_be_tx *tx, void *payload)
M0_INTERNAL void m0_be_tx_capture(struct m0_be_tx *tx, const struct m0_be_reg *reg)
M0_INTERNAL const char * m0_be_tx_state_name(enum m0_be_tx_state state)
struct m0_be_reg_area t_reg_area
M0_INTERNAL void m0_be_tx_payload_prep(struct m0_be_tx *tx, m0_bcount_t size)
int m0_be_tx_fol_add(struct m0_be_tx *tx, struct m0_fol_rec *rec)
M0_INTERNAL bool m0_be_tx__invariant(const struct m0_be_tx *tx)
void(* m0_be_tx_cb_t)(const struct m0_be_tx *tx)
struct m0_be_tx_remid M0_XCA_DOMAIN(be|rpc)
static struct m0_sm_state_descr states[C_NR]
static struct m0_be_ut_backend be
M0_INTERNAL void m0_be_tx_force(struct m0_be_tx *tx)
struct m0_be_engine * t_engine
M0_INTERNAL void m0_be_tx_close_sync(struct m0_be_tx *tx)