30 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DTM 55 cat_tlink_init(history);
56 exc_tlink_init(history);
66 exc_tlink_fini(history);
67 cat_tlink_fini(history);
76 #define H_STATE(field) (history->field->upd_up.up_state) 182 data->da_rule = rule;
187 data->da_orig_ver :
data->da_orig_ver + 1;
189 data->da_orig_ver = 0;
264 (*out)->h_remcookie =
id->hid_sender;
384 .updtt_name =
"close" 446 update->upd_up.up_hi != &history->
h_hi);
450 #undef M0_TRACE_SUBSYSTEM M0_INTERNAL void history_print_header(const struct m0_dtm_history *history, char *buf)
const struct m0_dtm_history_type_ops * hit_ops
struct m0_dtm_update * h_known
M0_INTERNAL void update_print_internal(const struct m0_dtm_update *update, bool history)
M0_INTERNAL m0_dtm_ver_t up_ver(const struct m0_dtm_up *up)
const struct m0_uint128 *(* hio_id)(const struct m0_dtm_history *history)
M0_INTERNAL void m0_dtm_controlh_fini(struct m0_dtm_controlh *ch)
M0_INTERNAL const struct m0_dtm_history_type * m0_dtm_history_type_find(struct m0_dtm *dtm, uint8_t id)
static const struct m0_dtm_update_ops ch_noop_ops
M0_INTERNAL bool m0_dtm_hi_invariant(const struct m0_dtm_hi *hi)
struct m0_dtm_remote * h_rem
M0_INTERNAL void m0_dtm_controlh_init(struct m0_dtm_controlh *ch, struct m0_dtm *dtm)
#define M0_LOG(level,...)
struct m0_cookie h_remcookie
#define UPDATE_UP(update)
M0_INTERNAL void m0_dtm_oper_init(struct m0_dtm_oper *oper, struct m0_dtm *dtm, struct m0_tl *uu)
M0_INTERNAL void m0_dtm_controlh_close(struct m0_dtm_controlh *ch)
M0_INTERNAL void m0_dtm_oper_prepared(const struct m0_dtm_oper *oper, const struct m0_dtm_remote *rem)
static void control_update_add(struct m0_dtm_history *history, struct m0_dtm_oper *oper, struct m0_dtm_update *cupdate, enum m0_dtm_up_rule rule, const struct m0_dtm_update_ops *ops)
struct m0_dtm_update * h_reint
M0_INTERNAL struct m0_dtm_up * hi_find(struct m0_dtm_hi *hi, m0_dtm_ver_t ver)
M0_INTERNAL struct m0_dtm_up * history_earliest(struct m0_dtm_history *history)
#define container_of(ptr, type, member)
static const struct m0_dtm_update_type ch_close_utype
M0_INTERNAL struct m0_dtm_update * up_update(struct m0_dtm_up *up)
M0_INTERNAL void dtm_lock(struct m0_dtm *dtm)
M0_INTERNAL void m0_dtm_history_fini(struct m0_dtm_history *history)
const struct m0_dtm_update_ops * upd_ops
M0_INTERNAL struct m0_dtm_history * hi_history(struct m0_dtm_hi *hi)
static const struct m0_dtm_update_type ch_noop_utype
M0_INTERNAL void history_lock(const struct m0_dtm_history *history)
M0_INTERNAL void m0_dtm_update_link(struct m0_tl *list, struct m0_dtm_update *update, uint32_t nr)
M0_INTERNAL void m0_dtm_history_balance(struct m0_dtm_history *history)
M0_TL_DESCR_DEFINE(exc, "excited histories", M0_INTERNAL, struct m0_dtm_history, h_exclink, h_hi.hi_ups.t_magic, M0_DTM_HI_MAGIX, M0_DTM_EXC_MAGIX)
M0_INTERNAL void m0_dtm_history_type_register(struct m0_dtm *dtm, const struct m0_dtm_history_type *ht)
M0_INTERNAL bool update_is_earlier(struct m0_dtm_update *update0, struct m0_dtm_update *update1)
M0_INTERNAL void m0_dtm_history_undo(struct m0_dtm_history *history, m0_dtm_ver_t upto)
#define M0_ERR_INFO(rc, fmt,...)
struct m0_dtm_update * h_persistent
#define UPDATE_HISTORY(update)
const struct m0_dtm_op_ops * op_ops
M0_INTERNAL void m0_dtm_history_persistent(struct m0_dtm_history *history, m0_dtm_ver_t upto)
M0_INTERNAL int m0_dtm_history_unpack(struct m0_dtm *dtm, const struct m0_dtm_history_id *id, struct m0_dtm_history **out)
static void clop_nop(struct m0_dtm_op *op)
struct m0_dtm_update * h_reset
M0_INTERNAL void m0_dtm_history_close(struct m0_dtm_history *history)
#define HISTORY_DTM(history)
M0_INTERNAL bool m0_dtm_controlh_update_is_close(const struct m0_dtm_update *update)
static const struct m0_dtm_update_ops ch_close_ops
#define m0_cookie_of(cookie, type, field)
M0_INTERNAL void m0_dtm_hi_fini(struct m0_dtm_hi *hi)
M0_INTERNAL m0_dtm_ver_t update_ver(const struct m0_dtm_update *update)
M0_INTERNAL void m0_cookie_init(struct m0_cookie *cookie, const uint64_t *obj)
M0_INTERNAL void m0_dtm_history_reset(struct m0_dtm_history *history, m0_dtm_ver_t since)
M0_INTERNAL void history_close(struct m0_dtm_history *history)
const struct m0_dtm_history_type * d_htype[M0_DTM_HISTORY_TYPE_NR]
M0_INTERNAL void m0_dtm_history_type_deregister(struct m0_dtm *dtm, const struct m0_dtm_history_type *ht)
M0_INTERNAL void m0_dtm_history_add_close(struct m0_dtm_history *history, struct m0_dtm_oper *oper, struct m0_dtm_update *cupdate)
void(* doo_ready)(struct m0_dtm_op *op)
M0_INTERNAL void m0_dtm_history_pack(const struct m0_dtm_history *history, struct m0_dtm_history_id *id)
M0_INTERNAL void oper_unlock(const struct m0_dtm_oper *oper)
static int ch_noop(struct m0_dtm_update *updt)
M0_INTERNAL void history_unlock(const struct m0_dtm_history *history)
M0_INTERNAL void m0_dtm_update_init(struct m0_dtm_update *update, struct m0_dtm_history *history, struct m0_dtm_oper *oper, const struct m0_dtm_update_data *data)
M0_INTERNAL bool m0_dtm_history_invariant(const struct m0_dtm_history *history)
static const struct m0_dtm_op_ops clop_ops
int(* hito_find)(struct m0_dtm *dtm, const struct m0_dtm_history_type *ht, const struct m0_uint128 *id, struct m0_dtm_history **out)
const struct m0_dtm_history_type * hio_type
M0_INTERNAL void m0_dtm_controlh_fuse_close(struct m0_dtm_update *update)
M0_INTERNAL int m0_dtm_controlh_update(struct m0_dtm_history *history, uint8_t id, struct m0_dtm_update *update)
M0_INTERNAL void m0_dtm_history_update_get(const struct m0_dtm_history *history, enum m0_dtm_up_rule rule, struct m0_dtm_update_data *data)
M0_INTERNAL void m0_dtm_oper_close(struct m0_dtm_oper *oper)
M0_INTERNAL void m0_cookie_new(uint64_t *gen)
M0_INTERNAL void m0_dtm_update_list_fini(struct m0_tl *list)
M0_INTERNAL void dtm_unlock(struct m0_dtm *dtm)
#define IS_IN_ARRAY(idx, array)
static const struct m0_dtm_history_type htype
#define history_for(h, update)
M0_INTERNAL void m0_dtm_history_init(struct m0_dtm_history *history, struct m0_dtm *dtm)
struct m0_dtm_update * h_undo
#define M0_UINT128(hi, lo)
M0_INTERNAL void m0_dtm_oper_fini(struct m0_dtm_oper *oper)
M0_INTERNAL void m0_dtm_update_list_init(struct m0_tl *list)
M0_INTERNAL void m0_dtm_hi_init(struct m0_dtm_hi *hi, struct m0_dtm_nu *nu)
static void clop_impossible(struct m0_dtm_op *op)
M0_INTERNAL struct m0_dtm_up * hi_earliest(struct m0_dtm_hi *hi)
M0_INTERNAL void m0_dtm_controlh_add(struct m0_dtm_controlh *ch, struct m0_dtm_oper *oper)
static const struct m0_uint128 * hid(const struct m0_dtm_history *history)
M0_INTERNAL void m0_dtm_history_add_nop(struct m0_dtm_history *history, struct m0_dtm_oper *oper, struct m0_dtm_update *cupdate)
M0_INTERNAL void oper_lock(const struct m0_dtm_oper *oper)
M0_TL_DEFINE(exc, M0_INTERNAL, struct m0_dtm_history)
M0_INTERNAL void history_print(const struct m0_dtm_history *history)
#define m0_tl_forall(name, var, head,...)
const struct m0_dtm_history_ops * h_ops
#define M0_IMPOSSIBLE(fmt,...)
int(* updo_redo)(struct m0_dtm_update *updt)
M0_INTERNAL struct m0_dtm_up * hi_latest(struct m0_dtm_hi *hi)
M0_INTERNAL struct m0_dtm_up * history_latest(struct m0_dtm_history *history)