Motr  M0
history.c File Reference
#include "lib/trace.h"
#include "lib/bob.h"
#include "lib/assert.h"
#include "lib/misc.h"
#include "lib/memory.h"
#include "lib/errno.h"
#include "lib/cookie.h"
#include "dtm/dtm_internal.h"
#include "dtm/machine.h"
#include "dtm/remote.h"
#include "dtm/nucleus.h"
#include "dtm/history.h"
#include "dtm/update.h"
#include "dtm/dtm.h"
Include dependency graph for history.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_DTM
 
#define H_STATE(field)   (history->field->upd_up.up_state)
 

Enumerations

enum  { H_NOOP = 1, H_CLOSE = 2 }
 

Functions

M0_INTERNAL void m0_dtm_history_init (struct m0_dtm_history *history, struct m0_dtm *dtm)
 
M0_INTERNAL void m0_dtm_history_fini (struct m0_dtm_history *history)
 
M0_INTERNAL bool m0_dtm_history_invariant (const struct m0_dtm_history *history)
 
M0_INTERNAL void m0_dtm_history_persistent (struct m0_dtm_history *history, m0_dtm_ver_t upto)
 
M0_INTERNAL void m0_dtm_history_reset (struct m0_dtm_history *history, m0_dtm_ver_t since)
 
M0_INTERNAL void m0_dtm_history_undo (struct m0_dtm_history *history, m0_dtm_ver_t upto)
 
M0_INTERNAL void m0_dtm_history_close (struct m0_dtm_history *history)
 
M0_INTERNAL void history_close (struct m0_dtm_history *history)
 
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 m0_dtm_ver_t update_ver (const struct m0_dtm_update *update)
 
M0_INTERNAL struct m0_dtm_historyhi_history (struct m0_dtm_hi *hi)
 
M0_INTERNAL struct m0_dtm_uphistory_latest (struct m0_dtm_history *history)
 
M0_INTERNAL struct m0_dtm_uphistory_earliest (struct m0_dtm_history *history)
 
M0_INTERNAL void m0_dtm_history_type_register (struct m0_dtm *dtm, const struct m0_dtm_history_type *ht)
 
M0_INTERNAL void m0_dtm_history_type_deregister (struct m0_dtm *dtm, const struct m0_dtm_history_type *ht)
 
M0_INTERNAL const struct m0_dtm_history_typem0_dtm_history_type_find (struct m0_dtm *dtm, uint8_t id)
 
M0_INTERNAL void m0_dtm_history_pack (const struct m0_dtm_history *history, struct m0_dtm_history_id *id)
 
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 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)
 
M0_INTERNAL void history_lock (const struct m0_dtm_history *history)
 
M0_INTERNAL void history_unlock (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)
 
static void clop_nop (struct m0_dtm_op *op)
 
static void clop_impossible (struct m0_dtm_op *op)
 
M0_INTERNAL void m0_dtm_history_add_close (struct m0_dtm_history *history, struct m0_dtm_oper *oper, struct m0_dtm_update *cupdate)
 
M0_INTERNAL void m0_dtm_controlh_init (struct m0_dtm_controlh *ch, struct m0_dtm *dtm)
 
M0_INTERNAL void m0_dtm_controlh_fini (struct m0_dtm_controlh *ch)
 
M0_INTERNAL void m0_dtm_controlh_close (struct m0_dtm_controlh *ch)
 
M0_INTERNAL void m0_dtm_controlh_add (struct m0_dtm_controlh *ch, struct m0_dtm_oper *oper)
 
static int ch_noop (struct m0_dtm_update *updt)
 
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_controlh_fuse_close (struct m0_dtm_update *update)
 
M0_INTERNAL bool m0_dtm_controlh_update_is_close (const struct m0_dtm_update *update)
 
 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_TL_DEFINE (exc, M0_INTERNAL, struct m0_dtm_history)
 
M0_INTERNAL void history_print_header (const struct m0_dtm_history *history, char *buf)
 
M0_INTERNAL void history_print (const struct m0_dtm_history *history)
 

Variables

static const struct m0_dtm_update_ops ch_close_ops
 
static const struct m0_dtm_update_ops ch_noop_ops
 
static const struct m0_dtm_op_ops clop_ops
 
static const struct m0_dtm_update_type ch_noop_utype
 
static const struct m0_dtm_update_type ch_close_utype
 

Macro Definition Documentation

◆ H_STATE

#define H_STATE (   field)    (history->field->upd_up.up_state)